Skip to content

Relative refs in parameters and schema are not resolved correctly #421

Closed
@mkistler

Description

@mkistler

If the value of a $ref is a relative reference but does not start with ".", the swagger core (specifically GenericRef) treats it as an internal ref. E.g.

"$ref" : "./path/to/model.json#/thing"

is treated as a relative URI but

"$ref": "path/to/model.json#/thing"

is treated as internal.

According to #306, this is intentional behavior in swagger core:

we added a convenience for a 1.2-style spec, where references did not need the full anchor.

So the parser needs to account for this by transforming actual relative refs into something that swagger-core will not try to treat as an internal ref.

The fix for #306 added code to make this transformation to relative refs that appear in properties. The same fix is needed for parameters and schema.

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