Skip to content

A reference is ignored #2671

Open
Open
@francoisthire

Description

@francoisthire

Describe the bug

In the following example, the reference for def-a (or def-b) is not printed but only inlined.

Expected behavior

I would expect to see a reference towards the definition

Minimal reproducible OpenAPI snippet(if possible)

{
  "openapi": "3.0.3",
  "info": {
    "title": "Example",
    "version": "0.1"
  },
  "paths": {
    "/api/configuration": {
      "get": {
        "summary": "Get the configuration",
        "description": "Get the current configuration",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "enum": [null],
                    },
                    {
                      "required": [
                        "one"
                      ],
                      "type": "object",
                      "properties": {
                        "one": {
                          "allOf": [
                            {
                              "$ref": "#/components/schemas/def-a"
                            },
                            {
                              "required": [
                                "two"
                              ],
                              "type": "object",
                              "properties": {
                                "two": {
                                  "allOf": [
                                    {
                                      "$ref": "#/components/schemas/def-b"
                                    },
                                    {

                                    }
                                  ]
                                }
                              }
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
  },
  "components": {
    "schemas": {
      "def-a": {
        "required": [
          "y"
        ],
        "type": "object",
        "properties": {
          "z": {
            "default": 5,
            "type": "integer"
          },
          "y": {
            "enum": [null],
            "description": "Unit"
          }
        }
      },
      "title-int": {
        "type": "integer"
      },
      "def-b": {
        "required": [
          "w"
        ],
        "type": "object",
        "properties": {
          "w": {
            "type": "string"
          }
        }
      }
    }
  }
}

Screenshots

Image

I would expect to see a reference to def-a and def-b in the output of /api/configuration

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions