Skip to content

Generated untyped JSON is not handled by OpenAPI spec parserΒ #295

@sbreatnach

Description

@sbreatnach

πŸ‘‹ When attempting to deserialise the OpenApi type from a simple JSON spec generated by aide, it fails with the error data did not match any variant of untagged enum ReferenceOr. FWIW the same spec is parsed without issue by redocly.

This is the spec that's failing:

{
  "openapi": "3.1.0",
  "info": {
    "title": "Test Integration",
    "description": "Good stuff.",
    "version": ""
  },
  "paths": {
    "/v1": {
      "get": {
        "responses": {
          "200": {
            "description": "",
            "content": { "application/json": { "schema": true } }
          },
          "500": { "description": "Internal server error" }
        }
      }
    }
  },
  "components": {}
}

I've created a simple repo to show how I'm generating this spec with aide and a test to reproduce the issue.
Apologies if this has been reported elsewhere, I couldn't find any existing issues on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions