Check...
Compare generated schemas with those in Quarkus 3.15.4 (see branch quarkus-3.15.4
).
- Example type:
UseSchemaImplementationType
- Uses
UseSchemaImplementationImpl
for@Schema(implemenation)
definition
- Uses
The type class (UseSchemaImplementationType
) has some internal properties and also some methods.
When I check the schema with Quarkus 3.20.0, I see the following schemas:
"UseSchemaImplementationImpl" : {
"type" : "object",
"properties" : {
"amount" : {
"type" : "number"
},
"currency" : {
"type" : "string"
}
}
},
"UseSchemaImplementationType" : {
"$ref" : "#/components/schemas/UseSchemaImplementationImpl",
"type" : "object",
"properties" : {
"value" : {
"type" : "string"
},
"internalValue" : {
"type" : "string"
},
"composite" : {
"type" : "boolean"
},
"null" : {
"type" : "boolean"
}
}
},
The problem: I have the ref
definition and also the properties and methods of UseSchemaImplementationType
.
Side note: I don't understand why methods are part of the schema!?
This is what I get with Quarkus 3.15.4 and what I expect:
"UseSchemaImplementationImpl" : {
"type" : "object",
"properties" : {
"amount" : {
"type" : "number"
},
"currency" : {
"type" : "string"
}
}
},
"UseSchemaImplementationType" : {
"$ref" : "#/components/schemas/UseSchemaImplementationImpl"
},
- Example type:
UseSchemaRefType
- Uses
UseSchemaRefDef
for@Schema(ref)
definition
- Uses
The type class (UseSchemaRefType
) has some internal properties and also some methods.
When I check the schema with Quarkus 3.20.0, I see the following schemas:
"MonetaryAmountSchema" : {
"properties" : {
"amount" : {
"type" : "number"
},
"currency" : {
"type" : "string"
}
},
"type" : "object"
},
"UseSchemaRefType" : {
"$ref" : "#/components/schemas/MonetaryAmountSchema",
"type" : "object",
"properties" : {
"value" : {
"type" : "string"
},
"internalValue" : {
"type" : "string"
},
"composite" : {
"type" : "boolean"
},
"null" : {
"type" : "boolean"
}
}
}
The problem: I have the ref
definition and also the properties and methods of UseSchemaRefType
.
Side note: I don't understand why methods are part of the schema!?
This is what I get with Quarkus 3.15.4 and what I expect:
"MonetaryAmountSchema" : {
"type" : "object",
"properties" : {
"amount" : {
"type" : "number"
},
"currency" : {
"type" : "string"
}
}
},
"UseSchemaRefType" : {
"$ref" : "#/components/schemas/MonetaryAmountSchema"
}
- Example type:
UseNativeType
- Uses
Date
for@Schema(implementation)
definition
- Uses
The type class (UseNativeType
) has some internal properties and also some methods.
When I check the schema with Quarkus 3.20.0, I see the following schemas:
"Date" : {
"type" : "string",
"format" : "date",
"examples" : [ "2022-03-10" ]
},
"UseNativeType" : {
"$ref" : "#/components/schemas/Date",
"type" : "object",
"properties" : {
"value" : {
"$ref" : "#/components/schemas/Date"
},
"internalValue" : {
"type" : "string"
},
"composite" : {
"type" : "boolean"
},
"null" : {
"type" : "boolean"
}
}
},
The problem: I have the ref
definition and also the properties and methods of UseNativeType
.
Side notes:
- I don't understand why methods are part of the schema!?
- When I use
type = SchemaType.STRING
it works fine, but this was not needed with Quarkus 3.15.4
This is what I get with Quarkus 3.15.4 and what I expect:
"Date" : {
"format" : "date",
"type" : "string",
"example" : "2022-03-10"
},
"UseNativeType" : {
"$ref" : "#/components/schemas/Date"
},
{
"openapi" : "3.1.0",
"components" : {
"schemas" : {
"Date" : {
"type" : "string",
"format" : "date",
"examples" : [ "2022-03-10" ]
},
"MonetaryAmountSchema" : {
"properties" : {
"amount" : {
"type" : "number"
},
"currency" : {
"type" : "string"
}
},
"type" : "object"
},
"UseNativeType" : {
"$ref" : "#/components/schemas/Date",
"type" : "object",
"properties" : {
"value" : {
"$ref" : "#/components/schemas/Date"
},
"internalValue" : {
"type" : "string"
},
"composite" : {
"type" : "boolean"
},
"null" : {
"type" : "boolean"
}
}
},
"UseSchemaImplementationImpl" : {
"type" : "object",
"properties" : {
"amount" : {
"type" : "number"
},
"currency" : {
"type" : "string"
}
}
},
"UseSchemaImplementationType" : {
"$ref" : "#/components/schemas/UseSchemaImplementationImpl",
"type" : "object",
"properties" : {
"value" : {
"type" : "string"
},
"internalValue" : {
"type" : "string"
},
"composite" : {
"type" : "boolean"
},
"null" : {
"type" : "boolean"
}
}
},
"UseSchemaRefType" : {
"$ref" : "#/components/schemas/MonetaryAmountSchema",
"type" : "object",
"properties" : {
"value" : {
"type" : "string"
},
"internalValue" : {
"type" : "string"
},
"composite" : {
"type" : "boolean"
},
"null" : {
"type" : "boolean"
}
}
}
}
},
"paths" : {
"/schema/UseNativeType" : {
"post" : {
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/UseNativeType"
}
}
},
"required" : true
},
"responses" : {
"201" : {
"description" : "Created"
},
"400" : {
"description" : "Bad Request"
}
},
"summary" : "Use Native Type",
"tags" : [ "Greeting Resource" ]
}
},
"/schema/UseSchemaImplementationType" : {
"post" : {
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/UseSchemaImplementationType"
}
}
},
"required" : true
},
"responses" : {
"201" : {
"description" : "Created"
},
"400" : {
"description" : "Bad Request"
}
},
"summary" : "Use Schema Implementation Type",
"tags" : [ "Greeting Resource" ]
}
},
"/schema/UseSchemaRefType" : {
"post" : {
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/UseSchemaRefType"
}
}
},
"required" : true
},
"responses" : {
"201" : {
"description" : "Created"
},
"400" : {
"description" : "Bad Request"
}
},
"summary" : "Use Schema Ref Type",
"tags" : [ "Greeting Resource" ]
}
}
},
"info" : {
"title" : "openapi-schema-reproducer API",
"version" : "1.0.0-SNAPSHOT"
},
"servers" : [ {
"url" : "http://localhost:8080",
"description" : "Auto generated value"
}, {
"url" : "http://0.0.0.0:8080",
"description" : "Auto generated value"
} ]
}
{
"openapi" : "3.0.3",
"info" : {
"title" : "openapi-schema-reproducer API",
"version" : "1.0.0-SNAPSHOT"
},
"servers" : [ {
"url" : "http://localhost:8080",
"description" : "Auto generated value"
}, {
"url" : "http://0.0.0.0:8080",
"description" : "Auto generated value"
} ],
"paths" : {
"/schema/UseNativeType" : {
"post" : {
"tags" : [ "Greeting Resource" ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/UseNativeType"
}
}
}
},
"responses" : {
"201" : {
"description" : "Created"
}
}
}
},
"/schema/UseSchemaImplementationType" : {
"post" : {
"tags" : [ "Greeting Resource" ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/UseSchemaImplementationType"
}
}
}
},
"responses" : {
"201" : {
"description" : "Created"
}
}
}
},
"/schema/UseSchemaRefType" : {
"post" : {
"tags" : [ "Greeting Resource" ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/UseSchemaRefType"
}
}
}
},
"responses" : {
"201" : {
"description" : "Created"
}
}
}
}
},
"components" : {
"schemas" : {
"Date" : {
"format" : "date",
"type" : "string",
"example" : "2022-03-10"
},
"MonetaryAmountSchema" : {
"type" : "object",
"properties" : {
"amount" : {
"type" : "number"
},
"currency" : {
"type" : "string"
}
}
},
"UseNativeType" : {
"$ref" : "#/components/schemas/Date"
},
"UseSchemaImplementationImpl" : {
"type" : "object",
"properties" : {
"amount" : {
"type" : "number"
},
"currency" : {
"type" : "string"
}
}
},
"UseSchemaImplementationType" : {
"$ref" : "#/components/schemas/UseSchemaImplementationImpl"
},
"UseSchemaRefType" : {
"$ref" : "#/components/schemas/MonetaryAmountSchema"
}
}
}
}