Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[Core, Rust Server, ASP.NET Core] Fix Codegen Operation Scope Consistency #3495
Description of the PR
bjgill left a comment
Have given it a quick review, and it looks broadly sensible. Just one thing below where I want to check the logic.
I don't know enough about ASP.NET to say anything sensible about the effect of your changes there, though.
@richardwhiuk Sorry it took so long to have a look to your pr
delete: summary: Remove a sth operationId: removeSth responses: '204': description: Operation successfull '404': description: not found security: - bearerAuth: - sth:delete
that should be translated to the following authorize annotation
[Authorize(Roles = "sth:delete")]
but your code returns the following
so something is going wrong on creating the
I'm slightly confused by your example, as I'm not sure how you were defining the
If you had something like the following:
components: securitySchemes: bearerAuth: scheme: bearer bearerFormat: token type: http security: - bearerAuth: - "sth:access"
Then note, that according to https://swagger.io/specification/#securityRequirementObject, the security requirement may not contain a list of scope names. In this case, the code will generate
If, instead, you were defining a
Can you let me know, so I can address any further issues here?
@richardwhiuk sry for my late answer
when there is something like this
delete: summary: Remove a sth operationId: removeSth responses: '204': description: Operation successfull '404': description: not found security: - bearerAuth: 
you are right - there can be an
but in my example of #3495 (comment) - the specific route must be annotated including the roles/ scopes
and yes, a global security annotation is currently missing - we should open a new issue for that
* master: (28 commits) [meta] Support Kotlin meta generator (OpenAPITools#4156) [Go][Server] minor enhancement to the template (OpenAPITools#4417) Replace the old ResourceSupport (OpenAPITools#4426) [Core, Rust Server, ASP.NET Core] Fix Codegen Operation Scope Consistency (OpenAPITools#3495) Add Go Server featureCORS option (OpenAPITools#4400) Fix treatment of nullable types in a few more places (OpenAPITools#4315) prefix local variable with localVar (OpenAPITools#4402) [kotlin][client] gson complete integration (OpenAPITools#4332) [kotlin] [bugfix] [maven-plugin]: prevent ClassCastException with boolean config options (OpenAPITools#4361) add sbt, bazel to integration (OpenAPITools#4416) Add a blog post tutorial about generating Java clients using OpenAPI v3 (OpenAPITools#4405) add freshcells to company list (OpenAPITools#4414) Update isSet when the object is received from callback. (OpenAPITools#4385) Ruby client nullable (OpenAPITools#4391) Fixes Kotlin client property names that include a dollar sign for template override (OpenAPITools#4351) [Python] [Performance] Avoid unnessacary checks inside the loop (OpenAPITools#4305) Add QEDIT as a company that's using OpenAPI Generator (OpenAPITools#4392) update cpp flag for pistache (OpenAPITools#4386) Feature optional emit default values (OpenAPITools#4347) skip the test as async call may have finished (OpenAPITools#4377) ...