Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to parse swagger 2.0 document that contains null value at examples #1959

Open
filzrev opened this issue Nov 26, 2024 · 0 comments
Open

Comments

@filzrev
Copy link

filzrev commented Nov 26, 2024

Describe the bug

When parsing swagger 2.0 document that contains null value at examples.
It failed to parse document with OpenApiError with message Expected a value and Pointer: null.

It's occurred when using Microsoft.OpenApi.Readers 2.0.0-preview2.
When using 1.6.22, It can successfully parse document without problems.

OpenApi File To Reproduce

{
  "swagger": "2.0",
  "info": {
    "title": "Example",
    "version": "1.0"
  },
  "paths": {
    "/": {
      "get": {
        "responses": {
          "200": {
            "description": "200:OK",
            "examples": {
              "application/json": {
                "dummyValue": null
              }
            }
          }
        }
      }
    }
  },
  "host": "localhost",
  "basePath": "/",
}

Expected behavior
OpenApiDocument.Parse(text).OpenApiDocument returns parsed OpenAPI documents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant