swagger-api / swagger-api/swagger-codegen
Swagger Spring Boot Code Gen - API docs don't reflect the actual YAML for Array return type
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
From @techlogix on September 22, 2016 13:51
Swagger File
# paste your swagger document here
responses:
"200":
description: successful operation
schema:
type: array
items:
$ref: "#/definitions/PaygoVendor"
/api-docs
responses: {
200: {
description: "successful operation",
schema: {
$ref: "#/definitions/PaygoVendor"
}
- Version: swagger.editor.io
- Browser/OS: all
Issue
There is a DIFFERENCE in the generated API spec from the Spring Boot generated source from the YAML spec for ARRAY return type.
Easy to replicate - basically
- define an API with in YAML a 200 schema type:array and items with a $ref.
schema:
type: array
items:
$ref: "#/definitions/PaygoVendor" - Generate Spring Boot Server Stub.
- Compile and run with maven.
- view /api-docs and the response type schema rendered is NOT an array anymore!
schema: {
$ref: "#/definitions/PaygoVendor"
}
Copied from original issue: swagger-api/swagger-editor#1068
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.
Research direction
Start with the provided Swagger YAML response schema and reproduce the issue by generating a Spring Boot server stub, compiling it with Maven, and viewing /api-docs. Compare the generated API documentation with the array schema and its $ref item; done means the rendered response remains an array.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- spring-boot
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100