swagger-api / swagger-api/swagger-codegen
Produce HTTP 501 Not Implemented in generated server stubs
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
When generating server from yaml file, it creates controllers with stub functions, which does return a default string 'do some magic'. I suggest that all these functions will return HTTP 501 Not Implemented in addition to the string, so it would be easier to spot these problems from the client side, and missing implementations won't return valid responses (HTTP 200 OK).
Implementing this feature shouldn't be very difficult. For example, the Python-Flask code should be changed from -
return 'do some magic!'
to -
return ('do some magic!', 501)
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 Python-Flask server generator templates and inspect how the generated stub functions return their default response. Extend the generated response behavior so unimplemented stubs expose HTTP 501 alongside the existing string, then verify the generated server output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100