From 64847f18d283aab3ecdeb35531cba2aaa5cc2e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20G=C3=B6rler?= Date: Wed, 22 Apr 2026 10:47:24 +0200 Subject: [PATCH 1/3] docu for protocols --- java/cqn-services/application-services.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/java/cqn-services/application-services.md b/java/cqn-services/application-services.md index 3d1062874b..b59b1ee59b 100644 --- a/java/cqn-services/application-services.md +++ b/java/cqn-services/application-services.md @@ -379,7 +379,7 @@ cds: With the annotation `@path`, you can configure the relative path of a service under which it's served by protocol adapters. The path is appended to the protocol adapter's base path. -With the annotations `@protocol` or `@protocols`, you can configure a list of protocol adapters a service should be served by. By default, a service is served by all installed protocol adapters. If you explicitly define a protocol, the service is only served by that protocol adapter. +With the annotations `@protocol` or `@protocols`, you can configure a list of protocol adapters a service should be served by. By default, a service is served by the protocols `odata-v4` and [odata-v2](../../java/migration#v2adapter). If you explicitly specify a protocol, the service is only served by that protocol adapter. In the following example, the service `CatalogService` is available on the combined paths `/odata/v4/browse` with OData V4 and `/odata/v2/browse` with OData V2: @@ -401,22 +401,33 @@ cds.application.services.CatalogService.serve: - 'odata-v2' ``` -Alternatively to the `@protocol` and `@protocols` annotation you can also use explicit protocol annotations like `@odata` (OData V4): +Alternatively to the `@protocol` and `@protocols` annotation you can also use explicit protocol annotations like `@odata` (OData V4), `@odata-v4`, `@odata-v2`, `@mcp`, ...: ```cds -@odata service CatalogService { ... } +@odata +service CatalogService { ... } +``` + +You can also specify the path directly in the protocol annotation: + +```cds +@mcp: 'catalog' +service CatalogService { ... } ``` You can also disable serving a service if needed: ```cds -@path : 'browse' @protocol: 'none' service InternalService { ... } ``` +```tip +Use the property `cds.protocols.defaults: []` to prevent that a protocol is accidently served by default. +``` + [Learn more about all `cds.application.services..serve` configuration possibilities.](../developing-applications/properties#cds-application-services--serve){.learn-more} From 98d11d29e71cc91ef7a28919a320db8bc30d6bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20G=C3=B6rler?= Date: Wed, 22 Apr 2026 10:53:15 +0200 Subject: [PATCH 2/3] typo --- java/cqn-services/application-services.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/cqn-services/application-services.md b/java/cqn-services/application-services.md index b59b1ee59b..4101aadaab 100644 --- a/java/cqn-services/application-services.md +++ b/java/cqn-services/application-services.md @@ -424,9 +424,9 @@ service InternalService { } ``` -```tip -Use the property `cds.protocols.defaults: []` to prevent that a protocol is accidently served by default. -``` +:::tip +Use the property cds.protocols.defaults: [] to prevent that a protocol is served accidently. +::: [Learn more about all `cds.application.services..serve` configuration possibilities.](../developing-applications/properties#cds-application-services--serve){.learn-more} From 7e1fb9932ecd7a1bced373bbfa3b8d76244272a1 Mon Sep 17 00:00:00 2001 From: Mahati Shankar <93712176+smahati@users.noreply.github.com> Date: Tue, 28 Apr 2026 23:53:52 +0200 Subject: [PATCH 3/3] cosmetics --- java/cqn-services/application-services.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/cqn-services/application-services.md b/java/cqn-services/application-services.md index 4101aadaab..6ba19fc37c 100644 --- a/java/cqn-services/application-services.md +++ b/java/cqn-services/application-services.md @@ -401,7 +401,7 @@ cds.application.services.CatalogService.serve: - 'odata-v2' ``` -Alternatively to the `@protocol` and `@protocols` annotation you can also use explicit protocol annotations like `@odata` (OData V4), `@odata-v4`, `@odata-v2`, `@mcp`, ...: +Alternatively to the `@protocol` and `@protocols` annotation you can also use explicit protocol annotations. For example, `@odata` (OData V4), `@odata-v4`, `@odata-v2`, and `@mcp`: ```cds @odata @@ -425,7 +425,7 @@ service InternalService { ``` :::tip -Use the property cds.protocols.defaults: [] to prevent that a protocol is served accidently. +Use the property cds.protocols.defaults: [] to prevent that a protocol is served accidentally. ::: [Learn more about all `cds.application.services..serve` configuration possibilities.](../developing-applications/properties#cds-application-services--serve){.learn-more}