swagger-api / swagger-api/swagger-codegen
@RolesAllowed for JaxRs for server Resource
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
I am using swagger-codegen to generate my resource and objects in my java backend. I want to generate:
@GET
@Path("myPath")
@RolesAllowed("myRole")
@Produces(MediaType.APPLICATION_JSON)
public Response operation(@QueryParam("field") String field) {
return service.operation(field);
}
But I don't manage to generate the @RolesAllowed("myRole").
I already checked the code from the repo but I don't even find the part where generates that part.
Is that possible?
(You may find this question rised by me also in stackoverflow)
Thanks! :)
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 tracing the Java server templates in swagger-codegen that render JAX-RS resource methods; the issue does not name a file or test. Check how operation-level authorization data is represented in the OpenAPI input and follow it through template rendering. Done means generated resources include the requested @RolesAllowed annotation when that configuration is present, with coverage for the generated output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, authorization, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100