Skip to content

Only resolve relevant $refs #12

@charjr

Description

@charjr

Current Behaviour

All references are resolved.

Issue

The router only needs to know the following:

  • OpenAPI Object
    • Servers (list of Server Objects)
    • Paths Object (array of relativeUrl => Path Object)
      • PathObject
        • Servers (list of Server Objects)
        • Parameters (list of Parameter Objects)
        • Operations(array of method => Operation Object)
          • Servers (list of Server Objects)
          • Parameters(list of Parameter Objects)

Resolving references outside of this adds unnecessary workload.

Desired Behaviour

Only resolve necessary references:

What can be a Reference?

A common misconception is that $ref is allowed anywhere in an OpenAPI specification file. Actually $ref is only allowed in places where the OpenAPI 3.0 Specification explicitly states that the value may be a reference.

Below is a list of what I can confirm is the OpenAPI 3.0 Specification has explicitly stated can be a reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions