swagger-api / swagger-api/swagger-codegen
[Spring] using schemas from domains do not work/exist once generated
Open
@gracekarina is already working on this.
Since Apr 22, 2020.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.