Example JSON-LD documents in new Management API #3143
Replies: 3 comments 3 replies
-
Can we use text blocks (""") to make the String look better? |
Beta Was this translation helpful? Give feedback.
-
created issue #3146 |
Beta Was this translation helpful? Give feedback.
-
I do not know if this really fits here, but I tried out the samples and noticed, that the type of the value of the |
Beta Was this translation helpful? Give feedback.
-
Our new Management API is lacking in terms of OpenAPI/Swagger documentation in the following aspect:
we are now using JSON-LD, which implies the use of
JsonObject
s, which are inherently generic. So far, we've skirted around the problem by listing the actualDto
as@Schema
in the OpenAPI annotations, but that is not quite right either, because it simply does not show how the actual JSON-LD structure would look like.I propose the following:
@ExampleObject
to the@Content
object of either the request or the responseUsing the
Catalog
endpoint, that would look like thisOf course there is much potential to improve this, e.g. auto-generating a static JSON file for every Dto that traverses the Management API, and reading the example JSON from that file, etc.
Then, Swagger-UI will render a much better example:
[edit] this would replace the
@Schema(implementation = ...)
structureBeta Was this translation helpful? Give feedback.
All reactions