Skip to content

can not resolve relative paths with schema $id if port number is specified #396

@bettydiegel-sf

Description

@bettydiegel-sf

When resolving references using schema $id URLs, if the value of the baseUri specifies a port number it's not retained.

Is it necessary to override the port number here?
https://github.com/APIDevTools/json-schema-ref-parser/blob/main/lib/index.ts#L102-L104

Proposing to use the URL host value specified:
Image

{ $id: 'https://localhost:44352/schema/root.json' }

A relative ref will fail to resolve for $ref: './schema/other.json'

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