-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Juan Cruz Viotti <[email protected]>
- Loading branch information
Showing
7 changed files
with
366 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
patches/jsonschema-draft4/0001-Fix-links-not-adhering-to-its-meta-schema-given-inva.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From 73a78fb9ed0fd2a6ad81b8b9ee17a35d57b58529 Mon Sep 17 00:00:00 2001 | ||
From: Juan Cruz Viotti <[email protected]> | ||
Date: Fri, 17 Jan 2025 14:16:29 -0400 | ||
Subject: [PATCH] Fix `links` not adhering to its meta-schema given invalid | ||
`dependencies` | ||
|
||
In Draft 4, `dependencies` is either a schema or an array of unique | ||
strings. | ||
|
||
See: https://json-schema.org/draft-04/draft-fge-json-schema-validation-00#rfc.section.5.4.5 | ||
See: https://www.learnjsonschema.com/draft4/validation/dependencies/ | ||
Signed-off-by: Juan Cruz Viotti <[email protected]> | ||
--- | ||
links.json | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/links.json b/links.json | ||
index de272cc..5c0d30d 100644 | ||
--- a/links.json | ||
+++ b/links.json | ||
@@ -36,6 +36,6 @@ | ||
"required" : ["rel", "href"], | ||
|
||
"dependencies" : { | ||
- "enctype" : "method" | ||
+ "enctype" : ["method"] | ||
} | ||
} | ||
\ No newline at end of file | ||
-- | ||
2.48.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
jsonschema-core.xml | ||
jsonschema-hyperschema.xml | ||
jsonschema-validation.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/hyper-schema#", | ||
"id": "http://json-schema.org/draft-04/hyper-schema#", | ||
"title": "JSON Hyper-Schema", | ||
"allOf": [ | ||
{"$ref": "http://json-schema.org/draft-04/schema#"} | ||
], | ||
"properties": { | ||
"additionalItems": { | ||
"anyOf": [ | ||
{"type": "boolean"}, | ||
{"$ref": "#"} | ||
] | ||
}, | ||
"additionalProperties": { | ||
"anyOf": [ | ||
{"type": "boolean"}, | ||
{"$ref": "#"} | ||
] | ||
}, | ||
"dependencies": { | ||
"additionalProperties": { | ||
"anyOf": [ | ||
{"$ref": "#"}, | ||
{"type": "array"} | ||
] | ||
} | ||
}, | ||
"items": { | ||
"anyOf": [ | ||
{"$ref": "#"}, | ||
{"$ref": "#/definitions/schemaArray"} | ||
] | ||
}, | ||
"definitions": { | ||
"additionalProperties": {"$ref": "#"} | ||
}, | ||
"patternProperties": { | ||
"additionalProperties": {"$ref": "#"} | ||
}, | ||
"properties": { | ||
"additionalProperties": {"$ref": "#"} | ||
}, | ||
"allOf": {"$ref": "#/definitions/schemaArray"}, | ||
"anyOf": {"$ref": "#/definitions/schemaArray"}, | ||
"oneOf": {"$ref": "#/definitions/schemaArray"}, | ||
"not": { "$ref": "#" }, | ||
|
||
"links": { | ||
"type": "array", | ||
"items": {"$ref": "#/definitions/linkDescription"} | ||
}, | ||
"fragmentResolution": { | ||
"type": "string" | ||
}, | ||
"media": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"description": "A media type, as described in RFC 2046", | ||
"type": "string" | ||
}, | ||
"binaryEncoding": { | ||
"description": "A content encoding scheme, as described in RFC 2045", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"pathStart": { | ||
"description": "Instances' URIs must start with this value for this schema to apply to them", | ||
"type": "string", | ||
"format": "uri" | ||
} | ||
}, | ||
"definitions": { | ||
"schemaArray": { | ||
"type": "array", | ||
"items": {"$ref": "#"} | ||
}, | ||
"linkDescription": { | ||
"title": "Link Description Object", | ||
"type": "object", | ||
"required": ["href", "rel"], | ||
"properties": { | ||
"href": { | ||
"description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing", | ||
"type": "string" | ||
}, | ||
"rel": { | ||
"description": "relation to the target resource of the link", | ||
"type": "string" | ||
}, | ||
"title": { | ||
"description": "a title for the link", | ||
"type": "string" | ||
}, | ||
"targetSchema": { | ||
"description": "JSON Schema describing the link target", | ||
"$ref": "#" | ||
}, | ||
"mediaType": { | ||
"description": "media type (as defined by RFC 2046) describing the link target", | ||
"type": "string" | ||
}, | ||
"method": { | ||
"description": "method for requesting the target of the link (e.g. for HTTP this might be \"GET\" or \"DELETE\")", | ||
"type": "string" | ||
}, | ||
"encType": { | ||
"description": "The media type in which to submit data along with the request", | ||
"type": "string", | ||
"default": "application/json" | ||
}, | ||
"schema": { | ||
"description": "Schema describing the data to submit along with the request", | ||
"$ref": "#" | ||
} | ||
} | ||
}, | ||
"readOnly": { | ||
"description": "If true, indicates that the value of this property is controlled by the server.", | ||
"type": "boolean", | ||
"default": false | ||
} | ||
}, | ||
"links": [ | ||
{ | ||
"rel": "self", | ||
"href": "{+id}" | ||
}, | ||
{ | ||
"rel": "full", | ||
"href": "{+($ref)}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"$schema" : "http://json-schema.org/draft-04/hyper-schema#", | ||
"id" : "http://json-schema.org/draft-04/links#", | ||
"type" : "object", | ||
|
||
"properties" : { | ||
"rel" : { | ||
"type" : "string" | ||
}, | ||
|
||
"href" : { | ||
"type" : "string" | ||
}, | ||
|
||
"template" : { | ||
"type" : "string" | ||
}, | ||
|
||
"targetSchema" : {"$ref" : "http://json-schema.org/draft-04/hyper-schema#"}, | ||
|
||
"method" : { | ||
"type" : "string", | ||
"default" : "GET" | ||
}, | ||
|
||
"enctype" : { | ||
"type" : "string" | ||
}, | ||
|
||
"properties" : { | ||
"type" : "object", | ||
"additionalProperties" : {"$ref" : "http://json-schema.org/draft-04/hyper-schema#"} | ||
} | ||
}, | ||
|
||
"required" : ["rel", "href"], | ||
|
||
"dependencies" : { | ||
"enctype" : ["method"] | ||
} | ||
} |
Oops, something went wrong.