Skip to Content
0
Aug 29, 2023 at 02:16 PM

Nested OpenAPI Spec Schema for PATCH/POST request in CAP

105 Views

I'm playing around with the OpenAPI preview in CAP and have added a Swagger UI in the Bookshop example (https://github.com/SAP-samples/cloud-cap-samples/tree/main/bookshop).

The admin service looks like this:

image.png

As you can see, it is possible to post books as part of an author. This is also reflected by the database model.

However, when I check the POST /Author route, I can only find an example (and a schema) for the highest level of the data structure. The nested entities (e.g. books) are not shown here:

image.png

In the response example the books are listed again:

image.png

Is it possible to show the nested entities also in the example/schema of the request body?

thanks and best regards,

Armin

Attachments

image.png (216.9 kB)
image.png (149.6 kB)
image.png (457.9 kB)