Closed
Description
Description
We have an use-case where description
and vendor extensions are put inside allOf
as inline schema. However those inlined fields went missing from the input to the generator as well as the final generated code. See below:
ModelA:
allOf:
- "$ref": "#/components/schemas/ModelBase"
- type: object
description: foo
properties:
value:
type: integer
description: TODO
x-model-version: '1.0'
x-model-module: model.base
x-model-base: [email protected]
Debug output run with -DdebugModels
which should be the same to any generators. Notice how top level x-model-base
is getting picked up in vendorExtensions while the extensions are not.
"model" : {
"parent" : "ModelBase",
"parentSchema" : "ModelBase",
"interfaces" : [ "ModelBase" ],
"name" : "ModelA",
"classname" : "ModelA",
"classVarName" : "ModelA",
"modelJson" : "{\n \"allOf\" : [ {\n \"$ref\" : \"#/components/schemas/ModelBase\"\n }, {\n \"type\" : \"object\",\n \"properties\" : {\n \"value\" : {\n \"type\" : \"integer\",\n \"description\" : \"TODO\",\n \"format\" : \"int32\"\n }\n },\n \"description\" : \"foo\",\n \"x-model-version\" : \"1.0\",\n \"x-model-module\" : \"model.base\"\n } ],\n \"x-model-base\" : \"[email protected]\"\n}",
"classFilename" : "ModelA",
"isAlias" : false,
"isString" : false,
"isInteger" : false,
"vars" : [],
"requiredVars" : [],
"optionalVars" : [],
"readOnlyVars" : [],
"readWriteVars" : [],
"allVars" : [],
"parentVars" : [ ],
"mandatory" : [ ],
"allMandatory" : [ ],
"imports" : [ "AttributeMetadata", "ModelBase" ],
"hasVars" : true,
"emptyVars" : false,
"hasMoreModels" : false,
"hasEnums" : false,
"isEnum" : false,
"hasRequired" : false,
"hasOptional" : true,
"isArrayModel" : false,
"hasChildren" : false,
"isMapModel" : false,
"hasOnlyReadOnly" : false,
"vendorExtensions" : {
"x-model-base" : "[email protected]"
}
}
}
According to the schema object spec, either way seems to be valid. Is this a bug, a feature by design or I misunderstand anything?
Thanks.
openapi-generator version
3.3.2, also happens with master.