Skip to content

OpenApiSchema.SerializeAsV2WithoutReference does not recursively serialize references #428

Description

@nth-commit

Version 1.1.4

Given the document:

{
  "swagger": "2.0",
  "paths": {
    "/foos": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "schema": {
              "$ref": "#/definitions/Foo"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "Foo": {
      "type": "object",
      "properties": {
        "bar": {
          "$ref": "#/definitions/Bar"
        }
      }
    },
    "Bar": {
      "type": "object",
      "properties": {
        "baz": {}
      }
    }
  }
}

When serializing the schema referenced by the path "/foos"

Expected:

{
  "type": "object",
  "properties": {
    "bar": {
      "type": "object",
      "properties": {
        "baz": {}
      }
    }
  }
}

Actual:

{
  "type": "object",
  "properties": {
    "bar": {
      "$ref": "#/definitions/Bar"
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions