You need to use the Create/Update API to pass in the URL of your swagger file. You can find an example here
Import Swagger file programatically to Azure APIM
I am trying to deploy some services to APIM, I am trying to use the APIM "Management API" .
However I couldn't find a way to import the swagger file to the APIM using these Management APIs.
Any suggestions?
Azure API Management
-
Sam Cogan 10,812 Reputation points Microsoft Employee Volunteer Moderator
2022-01-07T17:10:00.197+00:00
1 additional answer
Sort by: Most helpful
-
Sujith 26 Reputation points
2022-01-13T04:36:09.067+00:00 There is a way to pass the swagger as json text.
Posting it here , so that it could be helpful for any others.
Call the APIM management API to create API and pass the below in body.{
"properties": {
"format": "openapi+json",
"value": "<<swaggr json text goes here>>",
"path": "/"
}
}Please note that format should be "openapi+json" for open api version 3.1 and "swagger-json" for open api version 2.