Azure API Manager OpenApiSpecification parser claims errors where there are none

Jaime Huffman 56 Reputation points Microsoft Employee
2021-10-29T17:55:09.78+00:00

I have an OpenAPI hooked up to my Azure API manager. I have a valid OpenAPI json file that was generated by my Swagger API integration. I know it's valid because I have pasted into https://editor.swagger.io/ and it works fine without errors. However, if I try and paste it into my Azure API Manager in the Design ->Front End -> OpenApi Specification Editor and try to save it gives me a huge list of errors. Here is the start:

One or more fields contain incorrect values:
Parsing error(s): OpenAPI specification version '{ "openapi": "3.0.1", "info": { "title": "my api", "description": "desc", "contact": { "name": "my name", "email": "my email" }, "version": "1.0" }, "paths": { "/api/BuildInfo": { "get": { "tags": [ "BuildInfo" ], "summary": "my summary.", "parameters": [ { "name": "GateName", "in": "query", "required": true, "schema": { "type": "string" } }, { "name": "api-version", "in": "query", "description": "The requested API version", "schema": { "type": "string", "default": "1.0" } } ], "responses": { "200": { "description": "The gate build info was successfully retrieved.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GateBuildInfoODataValue" } } } }, "404"

And the errors go on and on for pretty much the entirety of the file. Weird, if I use the Import-AzApiManagementApi powershell command (https://learn.microsoft.com/en-us/powershell/module/az.apimanagement/import-azapimanagementapi?view=azps-6.5.0) it works fine. And then if I go to the Azure UI it shows my new json and if I try to click save with no modifications it gives me the errors. As far as I can tell the Azure API Manager UI validation has a bug in it and thinks that valid OpenAPI json is invalid.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,747 questions
{count} vote

Accepted answer
  1. MayankBargali-MSFT 68,396 Reputation points
    2021-11-05T04:21:03.92+00:00

    @Jaime Huffman @Christo Greeff @Denis Prohorenko Apology for the inconvenience due to this issue. There was a portal issue that was fixed yesterday (04/11). Can you please confirm if you are still observing the same behavior?

    If someone is still facing the issue while importing the open API then please refer to the unsupported OpenAPI spec for ver 3.0 x if this is not the case. If you validated that your open API spec does not have the unsupported fields then please feel free to tag me in or open a support ticket with us to assist you further.

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. guilherme munerato 0 Reputation points
    2023-03-14T14:21:40.7733333+00:00

    I'm facing the same error. After paste in https://editor.swagger.io/ and its works verry well. When I try to import from OpenAPI specification Az APIM. Returns :

    One or more fields contain incorrect values:

    • Please specify valid OpenAPI specification file.