swagger-api / swagger-api/swagger-codegen
Jaxrs-server: Support @ApiOperation authorizations scope attribute
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
The @ApiOperation authorizations attribute is currently not included in the generated code.
For details on authorizations/scopes:
https://swagger.io/docs/specification/authentication/
For details on Java @ApiOperation annotation:
https://github.com/swagger-api/swagger-core/wiki/Annotations-1.5.X#authorization-authorizationscope
Swagger-codegen version
master
Swagger declaration file content or url
"/hello": {
"get": {
"tags": [
"hello"
],
"summary": "",
"description": "",
"operationId": "sayHello",
...
"security": [
{
"HelloWorldAuth": [
"read:hello_world"
]
}
]
....
"securityDefinitions": {
"HelloWorldAuth": {
"type": "basic",
"scopes": {
"read:hello_world": "read hello world greetings"
}
},
Java-code:
@GET
@Path("/hello")
@ApiOperation(value = "", tags={ "hello", })
...
public String sayHello(@QueryParam("name") String name);
Suggest a fix/enhancement
Add support for security attribute / authorizations
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 JAX-RS server templates that generate the @ApiOperation annotation and trace how the declaration's security scopes are represented. Done means generated Java methods include the authorization or scope information from the OpenAPI security data; verify this with a representative generated server output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100