-
Notifications
You must be signed in to change notification settings - Fork 13
Description
How: List of performed steps
Generate an OpenAPI schema for an Aspect Model
What: Actual result vs expected result
Actual:
The schema will look something like this; where description
properties are created from the samm:description
of each samm:Property
, and additionally $ref
s are added to the schemas corresponding to the Characteristic.
TestEntity:
description: "Entity that has two Properties."
x-samm-aspect-model-urn: "urn:samm:org.eclipse.esmf.test:1.0.0#TestEntity"
type: object
properties:
myProperty1:
description: "This is the myProperty1 description."
x-samm-aspect-model-urn: "urn:samm:org.eclipse.esmf.test:1.0.0#myProperty1"
$ref: "#/components/schemas/Text"
myProperty2:
description: "This is the myProperty2 description."
x-samm-aspect-model-urn: "urn:samm:org.eclipse.esmf.test:1.0.0#myProperty2"
$ref: "#/components/schemas/Text"
required:
- myProperty1
- myProperty2
However, section 4.8.9.1 of the OpenAPI specification states that if both the defined object and the referenced object contain the same [property], the behaviour is undefined. In practice, tools handle this case differently: Redoc takes the description from the referenced schema, not the defined object. The swagger editor displayes a warning: "Sibling values alongside $refs are ignored". The schema generation must therefore be changed in a way ensures no properties are defined alongside a $ref
.
Expected:
A schema is generated that does not include undefined behaviour.