Class MirrorBasedOpenApiExtension
Identity types which are referenced from entities or value objects are "folded" in their mapping behaviour by the DLC Jackson extension. Jackson default behaviour would read and write only structures like:
{ "identityRef": { "value": "idValue" } }
This is simplified by to: { "identityRef": "idValue" }
In the same manner so called "singleValued" value object references are folded. This Open API extension, makes the api doc fit to that behaviour accordingly.
Also, id value fields are added to the API documentation of identity types. Regular Spring docs behaviour ignores those fields and gives Open API consumers wrong information. Primary identity properties are not required (for creating endpoints POST and PUT), that's why they are marked as not required.
The folding is also applied by to path and query parameters on API endpoints and hereby is corrected in the API documentation.-
Constructor Summary
ConstructorsConstructorDescriptionThis extension modifies and extends the Open API description for all DLC specific domain object classes, which are managed by the givenDomain. -
Method Summary
Modifier and TypeMethodDescriptionvoidextendOpenAPISchemaForDLCTypes(io.swagger.v3.oas.models.OpenAPI openAPI, String... entitiesWithExternallyProvidedIds) Starting point for all Open API specific extensions and corrections by this class.
-
Constructor Details
-
MirrorBasedOpenApiExtension
public MirrorBasedOpenApiExtension()This extension modifies and extends the Open API description for all DLC specific domain object classes, which are managed by the givenDomain.
-
-
Method Details
-
extendOpenAPISchemaForDLCTypes
public void extendOpenAPISchemaForDLCTypes(io.swagger.v3.oas.models.OpenAPI openAPI, String... entitiesWithExternallyProvidedIds) Starting point for all Open API specific extensions and corrections by this class.- Parameters:
openAPI-OpenAPIinstance to be extendedentitiesWithExternallyProvidedIds- array of full qualified class names of entities which require primary identities
-