swagger-api / swagger-api/swagger-core
swagger-annotations: Add annotations to support x-enum-descriptions and x-enum-varnames
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 7.5k
- Forks
- 2.3k
- Avg merge
- 18h 1m
- Merged PRs (30d)
- 10
Description
Add annotations to support x-enum-descriptions and x-enum-varnames.
More information here: https://openapi-generator.tech/docs/templating/#enum
Example
This java code:
public enum SignType {
SIGNTYPE_PADES("PAdES"),
SIGNTYPE_XADES("XAdES"),
SIGNTYPE_CADES("CAdES");
public final String value;
SignType(String value){
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
}
Generates an openapi.json like this:
"schema" : {
"type" : "string",
"enum" : [ "PAdES", "XAdES", "CAdES" ]
}
And Client generation produces:
public enum SignType {
PAD_ES("PAdES"),
XAD_ES("XAdES"),
CAD_ES("CAdES");
}
But I needs anything like this:
public enum SignType {
/** Signtype PAdES */
SIGNTYPE_PADES("PAdES"),
/** Signtype XAdES */
SIGNTYPE_XADES("XAdES"),
/** Signtype CAdES */
SIGNTYPE_CADES("CAdES");
...
}
I need annotations to generate x-enum-descriptions and x-enum-varnames in openapi.json file
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 by locating the swagger-annotations enum annotation handling and review the linked OpenAPI Generator enum templating documentation. Define how annotations should represent x-enum-descriptions and x-enum-varnames, then verify the shown SignType example produces the requested OpenAPI metadata and generated enum comments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100