postmanlabs / openapi-to-postman

Plugin for converting OpenAPI 3.0 specs to the Postman Collection (v2) format
Apache License 2.0
912 stars 196 forks source link

Problem with importing Azure API Managment exported API specification #790

Closed Lars-Kolsaker closed 4 months ago

Lars-Kolsaker commented 4 months ago

Hi

When trying to import the file we exported from Azure API Management to Postman using the https://api.getpostman.com/import/openapi?workspace=** in Postman we got the following response.

{
    "error": {
        "name": "invalidSchemaError",
        "message": "Specification must contain a semantic version number of the OAS specification"
    }
}

We used the following parameters in the body

image

According to the validator at https://apitools.dev/swagger-parser/online/ the specification is valid

{
  "openapi": "3.0.1",
  "info": {
    "title": "Listener Avonova Digital API",
    "description": "",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://apim-**************"
    }
  ],
  "paths": {
    "/location/{id}": {
      "delete": {
        "summary": "Delete location",
        "description": "Delete Avonova Digital location",
        "operationId": "delete-location",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the location to delete",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      },
      "put": {
        "summary": "Update location",
        "description": "Update Avonova Digital location",
        "operationId": "update-location",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the location to update",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
  },
  "components": {
    "securitySchemes": {
      "apiKeyHeader": {
        "type": "apiKey",
        "name": "Adp-Listener-AvoDig-Api-Subscription-Key",
        "in": "header"
      },
      "apiKeyQuery": {
        "type": "apiKey",
        "name": "Adp-Listener-AvoDig-Api-Subscription-Key",
        "in": "query"
      }
    }
  },
  "security": [
    {
      "apiKeyHeader": [ ]
    },
    {
      "apiKeyQuery": [ ]
    }
  ]
}

Kind regards Lars

Lars-Kolsaker commented 4 months ago

Hi By changing the type from json to string it worked. Closing the issue.

Lars