swagger-api / swagger-api/swagger-codegen
[Swift] swift documentation: response headers and examples repeat output
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
API Function documentation block:
headers and examples all elements are output, but it's repeated.
maybe number of elements.
Swagger-codegen version
2.3.1
Swagger declaration file content or url
Spec File:
http://petstore.swagger.io/v2/swagger.json
UserAPI.swift:
/**
Logs user into the system
- GET /user/login
-
- responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(NSDate)]
- responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(NSDate)]
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]
- examples: [{contentType=application/xml, example=aeiou}, {contentType=application/json, example="aeiou"}]
- parameter username: (query) The user name for login
- parameter password: (query) The password for login in clear text
- returns: RequestBuilder<String>
*/
api.mustache (swift/swift3/swift4):
- name: {{name}}{{/authMethods}}{{#responseHeaders}}
- responseHeaders: {{responseHeaders}}{{/responseHeaders}}{{#examples}}
- examples: {{{examples}}}{{/examples}}{{#externalDocs}}
Command line used for generation
swagger-codegen generate \
-i http://petstore.swagger.io/v2/swagger.json \
-l swift4 \
-o ./swift4-client
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 api.mustache templates for swift, swift3, and swift4, then generate the client using the provided petstore Swagger URL and command. Compare the generated UserAPI.swift documentation with the issue example. Done means each responseHeaders and examples entry appears once rather than being repeated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100