Add support for generating the SecuritySchema of the Swagger using real Key Manager information. #12538
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
To add the improvement to the code when the key manager ID will be passed as a query param to the GET swagger request in the devportal, the grants available for that particular key manager will be appended to the swagger definition.
Goal
Resolves: wso2/api-manager#3044
Approach
After this code enhancement, users at the devportal can download the OAS3 definition with the default key manager information because the try-out page only supports the default key manager.
Additionally, users can pass the key manager ID as a query parameter in the curl request as follows to retrieve an OAS3 definition with the specific key manager information supported by OAS3.
curl 'https://<HOST>:<PORT>/api/am/devportal/v2/apis/<API_UUID>/swagger?environmentName=Default&query=kmId%3A<KEY_MANGER_UUID>' -H 'Accept: application/json' -H 'Authorization: Bearer <ACCESS_TOKEN>' -k -i