OpenAPITools / OpenAPITools/openapi-generator
Swagger Annotations: Who Are They For?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
While looking at cleaning up dependencies for my generated models, I saw that swagger annotations are always imported and would require a code change to exclude from imports. My question is: why is this a feature at all?
https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Annotations
My understanding of these annotations is that their main purpose is to support a code first style of programming - i.e. where you use your own hand coded models with these annotations to generate a spec for consumers. But with codegen we are using design first programming. The spec is your input, not your output. So why would I ever need swagger annotations put on a model that is being generated from a spec that already exists?
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 generated-model import behavior described in the issue and read the linked Swagger 2.X annotations documentation. Determine whether annotations are required for generated models and define the desired exclusion behavior before making any change; no file or test is named.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100