Why does Azure API Management OpenAPI 2.0 JSON Export of our API include a securityDefinitions object sometimes?
Jeff Hellman
5
Reputation points
We have an API defined in APIM that when we do an OpenAPI 2.0 export of the JSON it sometimes returns a securityDefinitions
object that includes the subscription keys (example below):
"securityDefinitions": {
"apiKeyHeader": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
},
"apiKeyQuery": {
"type": "apiKey",
"name": "subscription-key",
"in": "query"
}
},
"security": [
{
"apiKeyHeader": []
},
{
"apiKeyQuery": []
}
]
This isn't consistent and we can't seem to find a rhyme or reason as to why APIM is including that in the export sometimes. The Subscription section of the API settings does not have the Subscription required
box checked, nor does it seem toggling that field makes a difference for the export behavior.
What drives the inclusion of those sections in the exported API swagger?
Sign in to answer