forked from loafle/openapi-generator-original
[Issue#392] Correct issue with OAuth scopes not propogated correctly (#1982)
If a path defined security to an OAuth type, and defined scopes, the scopes from the components definition were still being used, rather than the (most likely shorter) list of specific scopes for the path. This copies all the component security information over EXCEPT for the scopes. The scopes to be included are determined by the path's security settings. NOTE: Modified the petstore.yaml file so the GET operations only have read:pets scope and utilized the Kotlin server sample to verify output. Sample output updated only for this scenario
This commit is contained in:
committed by
William Cheng
parent
b5ede4b339
commit
67b3766332
@@ -66,7 +66,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
notes = "Multiple status values can be provided with comma separated strings",
|
||||
response = Pet::class,
|
||||
responseContainer = "List",
|
||||
authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
|
||||
authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])])
|
||||
@ApiResponses(
|
||||
value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")])
|
||||
@RequestMapping(
|
||||
@@ -83,7 +83,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
|
||||
response = Pet::class,
|
||||
responseContainer = "List",
|
||||
authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])])
|
||||
authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])])
|
||||
@ApiResponses(
|
||||
value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")])
|
||||
@RequestMapping(
|
||||
|
||||
Reference in New Issue
Block a user