Skip to content

Can not parse openapi spec with recursive references #309

@hottestseason

Description

@hottestseason

It looks this library fail to parse spec which has recursive references like this
https://github.com/hottestseason/kin-openapi/tree/f9ccdc2e69d360c4f17a7c94189526457e90b1f3/openapi3/testdata/recursiveRef

openapi: "3.0.3"
info:
  title: Recursive refs example
  version: "1.0"
paths:
  /foo:
    $ref: ./paths/foo.yml
components:
  schemas:
    Foo:
      $ref: ./components/Foo.yml
    Bar:
      $ref: ./components/Bar.yml
get:
  responses:
    "200":
      description: OK
      content:
        application/json:
          schema:
            type: object
            properties:
              foo:
                $ref: ../openapi.yml#/components/schemas/Foo
type: object
properties:
  bar:
    type: array
    items:
      $ref: ../openapi.yml#/components/schemas/Bar
type: string
example: bar

It works when loading bundled version such as using swagger-cli bundle

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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