Share via

OpenAPI 3.1.0 file importation fails in Azure APIM

Guillaume LUDWIG 5 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.


4 answers

Sort by: Most helpful
  1. Rob Stewart 0 Reputation points
    2026-01-20T14:53:33.4333333+00:00

    We are in the same position. We have bumped to .NET 10 and attempting to be good and keep current with our packages but are unable to publish to APIM. May you please provide a roadmap for when APIM will support publishing of Open API 3.1 schema?

    In the meantime, should anyone else stumble over this, you can use the following options to stay with the latest package but specify the schema version produced:

    Via DI registration which will only affect the document served up at runtime:

    builder.Services.AddOpenApi(options =>
    {
        options.OpenApiVersion = Microsoft.OpenApi.OpenApiSpecVersion.OpenApi3_0;
    });
    

    Via csproj which will affect the documents generated at build time if you are doing so:

    <OpenApiGenerateDocumentsOptions>--openapi-version OpenApi3_0</OpenApiGenerateDocumentsOptions>
    

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Gerard C 0 Reputation points
    2025-11-26T21:58:12.86+00:00

    With the release of NET 10 and Microsoft.OpenApi generating 3.1 by default, full 3.1 support is even more important. I just tested migration from Swagger to Microsoft.OpenAPI v3.1 only to have it fail on the APIM import.

    Do you have any update on plans to fully support the OpenAPI 3.1 generated by Microsoft.OpenAPI?

    Thanks,

    --Gerard

    Was this answer helpful?


  3. Kishore Srirama 0 Reputation points
    2025-07-31T15:18:21.97+00:00

    Hi @Shireesha Eeraboina ,

    Do we have an update when Azure APIM will support Open API 3.1 ?

    Regards,

    Kishore.S

    Was this answer helpful?

    0 comments No comments

  4. Guillaume LUDWIG 5 Reputation points
    2025-03-14T07:59:56.37+00:00

    Hi, my turn to say sorry for the delay @Anonymous and @RChotu

    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 ?

    Was this answer helpful?

    0 comments No comments

Your answer

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