-
-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
Description
In an OpenAPI doc like in the details, the $ref from one type should resolve to the other.
As I understand the OpenAPI and JSON Schema specs, the relative URI $ref should be resolved to an absolute URI using the context of the schema's $id if present, and that value should be checked against other already-resolved $ids. It seems that $ids are not checked, currently.
openapi: 3.1.0
components:
schemas:
s1: # This object should be resolvable at "https://example.com/a.json" from anywhere, and "#/components/schemas/s1" from a schema object without a "$schema" field.
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "https://example.com/a.json"
type: "string"
s2:
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "https://example.com/b.json"
$ref: "a.json" # becomes "https://example.com/a.json", which should already be resolved.This is freehand, so there may be some problem; sorry. I can try to bust down my real-world OpenAPI spec if needed.
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request