Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Technical guidelines: Clarify what to do when service contracts already exist in a module not suffixed with "Api" #3524

Merged
merged 8 commits into from
Apr 10, 2019
2 changes: 1 addition & 1 deletion guides/v2.2/coding-standards/technical-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ class View extends Template

6.4.1. Location of API interfaces

6.4.1.1. Service contract interfaces SHOULD be placed in separate API modules. The other modules will depend on the API module, and implementations could be easily swapped via `di.xml`. API module namess must end with the `Api` suffix. For example, if a module is named `MyModule`, its APIs SHOULD be declared in a module named `MyModuleApi`.
6.4.1.1. Service contract interfaces SHOULD be placed in separate API modules, except when an existing module already contains Service Contracts in the ` Api` folder. Other modules will depend on the API module, and implementations could be easily swapped via `di.xml`. API module names must end with the `Api` suffix. For example, if a module is named `MyModule`, its APIs SHOULD be declared in a module named `MyModuleApi`.

6.4.1.2. Service interfaces that should be exposed as web APIs MUST be placed under the `MyModuleApi/Api` directory. Service data interfaces MUST be placed under `MyModuleApi/Api/Data`. Directories under `MyModuleApi/Api` SHOULD NOT be nested.

Expand Down