[JSON Schema] Add base Hydra properties to collection items definition #3803
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is part of a set of PR whose purpose is to make the assertions
assertMatchesResourceItemJsonSchemaandassertMatchesResourceCollectionJsonSchemawork correctly.The PR are:
additionalProperties(false) to the generated JSON schema #3804It adds the base Hydra properties (
@id,@type) to collection items definition in the JSON Schema.Before:
{ "$schema":"http:\/\/json-schema.org\/draft-07\/schema#", "type":"object", "definitions":{ "Application:jsonld":{ "type":"object", "description":"", "properties":{ "id":{ "readOnly":true, "type":"integer" }, "name":{ "type":"string" } } } }, "properties":{ "hydra:member":{ "type":"array", "items":{ "$ref":"#\/definitions\/Application:jsonld" } }, "hydra:totalItems":{ "type":"integer", "minimum":0 }, "hydra:view":{ "type":"object", "properties":{ "@id":{ "type":"string", "format":"iri-reference" }, "@type":{ "type":"string" }, "hydra:first":{ "type":"string", "format":"iri-reference" }, "hydra:last":{ "type":"string", "format":"iri-reference" }, "hydra:next":{ "type":"string", "format":"iri-reference" } } }, "hydra:search":{ "type":"object", "properties":{ "@type":{ "type":"string" }, "hydra:template":{ "type":"string" }, "hydra:variableRepresentation":{ "type":"string" }, "hydra:mapping":{ "type":"array", "items":{ "type":"object", "properties":{ "@type":{ "type":"string" }, "variable":{ "type":"string" }, "property":{ "type":"string" }, "required":{ "type":"boolean" } } } } } } }, "required":[ "hydra:member" ] }After:
{ "$schema":"http:\/\/json-schema.org\/draft-07\/schema#", "type":"object", "definitions":{ "Application:jsonld":{ "type":"object", "description":"", "properties":{ "@id":{ "readOnly":true, "type":"string" }, "@type":{ "readOnly":true, "type":"string" }, "id":{ "readOnly":true, "type":"integer" }, "name":{ "type":"string" } } } }, "properties":{ "hydra:member":{ "type":"array", "items":{ "$ref":"#\/definitions\/Application:jsonld" } }, "hydra:totalItems":{ "type":"integer", "minimum":0 }, "hydra:view":{ "type":"object", "properties":{ "@id":{ "type":"string", "format":"iri-reference" }, "@type":{ "type":"string" }, "hydra:first":{ "type":"string", "format":"iri-reference" }, "hydra:last":{ "type":"string", "format":"iri-reference" }, "hydra:next":{ "type":"string", "format":"iri-reference" } } }, "hydra:search":{ "type":"object", "properties":{ "@type":{ "type":"string" }, "hydra:template":{ "type":"string" }, "hydra:variableRepresentation":{ "type":"string" }, "hydra:mapping":{ "type":"array", "items":{ "type":"object", "properties":{ "@type":{ "type":"string" }, "variable":{ "type":"string" }, "property":{ "type":"string" }, "required":{ "type":"boolean" } } } } } } }, "required":[ "hydra:member" ] }