carbon-apimgt
carbon-apimgt copied to clipboard
Add support for generating the SecuritySchema of the Swagger using real Key Manager information.
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: https://github.com/wso2/api-manager/issues/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