OpenAPI 3.1.0 file importation fails in Azure APIM

Guillaume LUDWIG 0 Reputation points
2025-02-05T14:47:19.6333333+00:00

Hi,

When I try to manually import a OpenAPI 3.1.0 file into the API Management in Azure, it fails and complains that the file isn’t valid :

Parsing error(s): The input OpenAPI file is not valid for the OpenAPI specification https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md(schemahttps://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v3.0/schema.yaml).

But my file is OpenAPI 3.1.0, not 3.0.1. In the json, the value "openapi" is "3.1.0".

To my understanding of the documentation, it should support this version.

Any help ?

Regards,

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,446 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Guillaume LUDWIG 0 Reputation points
    2025-03-14T07:59:56.37+00:00

    Hi, my turn to say sorry for the delay @Shireesha Eeraboina and @RithwikBojja

    Here is a minimal example of a OpenAPI 3.1 file with only one nullable property : 

    {
      "openapi": "3.1.0",
      "info": {
        "title": "Test",
        "version": "1"
      },
      "paths": {
        "/test_path": {
          "get": {
            "responses": {
              "200": {
                "description": "",
                "content": {
                  "application/json": {
                    "schema": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/myObject"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "components": {
        "schemas": {
          "myObject": {
            "type": "object",
            "properties": {
              "myProperty": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    }
    
    

    It has been generated with https://editor-next.swagger.io/ and the result is correctly displayed on it as shown in the attached image. And it works as expected elsewhere (internal tooling, openapi viewers, etc).microsoft_openapi_issue.png

    Except it won’t work on Azure APIM, I attached an image of the error during import.[azure_apim_import_error.png](/api/attachments/42479827-df07-4570-abcd-9e2fd6ac5ca6?platform=QnA)

    I’m quite sure this is a bug in Azure APIM, because the example is valid OpenAPI 3.1 data, and none of the "limitations" listed on APIM documentation are used here. Plus this is really a trivial example, only a single array of an object containing one nullable string.

    Does it help you ?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.