cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Localised Entities being shown in generated Open API

calmservices
Associate
Associate
0 Likes
1,875

Hi Colleagues,

I have a simple entity with one of the fields localized as show below in my service.cds file

entity Attributes : cuid {
contextType : Association to ContextTypes;
name : String(255);
description : localized String(500);
sequence : Integer;
}

I am using the following command in my POM to generate Open API Documentation
compile srv --service all -o docs/my_api --to openapi

The generated API Documentation has now both the Attributes and Attributes_texts. Is there a way to avoid displaying such entities having localized fields in Open API generated via CAP ? Because such entities have not been auto exposed (Attributes_texts) and only the parent entity has been (Attributes)

View Entire Topic
gregorw
SAP Mentor
SAP Mentor
0 Likes

Please check the documentation:

Omitting Elements from APIs

calmservices
Associate
Associate
0 Likes

Hi gregorw

I tried the following

I see the Attributes_Texts still coming up in the Open API. This Attributes_texts is a generated table which has a locale, ID and description (the column in attributes table which is localized)

gregorw
SAP Mentor
SAP Mentor
0 Likes

Have you tried adding the annotation to to the Attributes_texts entity?

hjb
Product and Topic Expert
Product and Topic Expert
0 Likes

that wouldn't help, the whole '.texts' entity should not become visible IIUC, see my answer below.