json-schema-org / website

JSON Schema website
https://json-schema.org
Other
40 stars 120 forks source link

Enumerate key architectural principles #135

Open handrews opened 4 years ago

handrews commented 4 years ago

There are some underlying principles that the JSON Schema project has been based on, but we've never really written them out. A concise list would be appropriate in the Core spec, as they might head off a few questions.

They also provide some general guidance on how to design keywords for extension vocabularies.

†Note that a JSON object with duplicate property names is syntactically legal but does not have well-defined behavior per RFC 8259. There are also limits on floating point interoperability.

††this is why we split dependencies which changed classification depending on whether it was an object of schemas or an object of string arrays.

Are there any other such principles? I don't think I want to include general principles like "least power", just the ones that couldn't be found anywhere else but within JSON Schema.

gregsdennis commented 4 years ago

I think something about it being a constraint-based system, and as a result, concepts like inheritance do not fit well.

Relequestual commented 4 years ago

I feel like we should say something about Meta-Data Annotations and the semantic meaning of such keywords, but I'm not sure what... I know that's not directly helpful but it might spark some other thoughts.

handrews commented 4 years ago

Everything in JSON Schema is addressed using URI-references (including full URIs) or Relative JSON Pointer. Those are the two things that we use today (URIs everywhere, Relative JSON pointer in Hyper-Schema).

This principle would have flushed out problems with OpenAPI's discriminator keyword, which addresses schemas by their name in the definitions (OAS2) or components (OAS3) structure.

handrews commented 4 years ago

Also, JSON Schema does not include anything about performing I/O to fetch schemas or other resources. This will get addressed in detail through json-schema-org/json-schema-spec#849. But it's worth calling out. JSON Schema specifies how to handle schemas and instances that have been parsed and loaded into memory (or are being processed as a stream, or whatever). It does not specify how things get parsed and loaded. json-schema-org/json-schema-spec#849 is really about clarifying that boundary.

Relequestual commented 4 years ago

@handrews Given you expressed wanting to bump this issue, I'll migreate it to the website repo. I think this would fit on an "implementation advice" page or similar.

benjagm commented 7 months ago

is this suitable content for the new For implementers section? @Julian @Relequestual

Julian commented 7 months ago

They seem like they should be evaluated/agreed upon to see if all the people writing the spec indeed think they're true guiding principles -- but otherwise to me yeah I think so!