Skip to content

Expander: the expanded spec is unusable to resolve circular $ref #180

Description

@fredbi

This is a nasty bug: so far I've failed to nail it.

When expanding schemas in a spec for further use (e.g. validating the spec, flattening it with the expand option),
circular $ref are left in a unusable state in the $ref cache, leading to jsonpointer errors (e.g. "xxx has no key yyy")
when attempting to resolve.

This is for example the root cause for go-swagger/go-swagger#2346.
In go-swagger, it is possible to work around this issue by reloading the spec as a fresh go-openapi/loads.Document,
but this is not ideal.
This workaround is used on 2 occasions in go-swagger:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions