swagger-codegen
swagger-codegen copied to clipboard
[Spring] using schemas from domains do not work/exist once generated
I have a domain with the following schema in it
components:
####################
# Common data models
####################
schemas:
ServerResponse:
type: object
properties:
error:
type: string
example: "Authorization"
suberror:
type: string
example: "Password Expired"
return_code:
type: string
example: "200"
and it gets used in a scehma in my api
ShipmentBasicInfoResponse:
type: object
properties:
headers:
$ref: 'https://api.swaggerhub.com/domains/COMPANY/DOMAIN/VERSION#/components/schemas/ServerResponse'
body:
$ref: '#/components/schemas/ShipmentBasicInfo'
I'm generating the server through swaggerhub. When this gets generated into a spring boot server, I the ShipmentBasicInfoResponse object builds with the following field
@Valid
public HttpsapiSwaggerhubComdomainsCOMPANYDOMAINVERSIONcomponentsschemasServerResponse getHeaders() {
return headers;
}
HttpsapiSwaggerhubComdomainsCOMPANYDOMAINVERSIONcomponentsschemasServerResponse is not a class that was generated, making the class that calls it unusable and the project unable to compile.