json-schema-org / website

JSON Schema website
https://json-schema.org
Other
67 stars 174 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 12 months ago

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

Julian commented 11 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!

github-actions[bot] commented 1 month ago

Hello! :wave:

This issue has been automatically marked as stale due to inactivity :sleeping:

It will be closed in 180 days if no further activity occurs. To keep it active, please add a comment with more details.

There can be many reasons why a specific issue has no activity. The most probable cause is a lack of time, not a lack of interest.

Let us figure out together how to push this issue forward. Connect with us through our slack channel : https://json-schema.org/slack

Thank you for your patience :heart: