Improve the use of JSON Schema in tooling beyond validation #18
Replies: 7 comments 30 replies
-
I think this is all great and having the JSON Schema organization host this project is a good idea. However, it will have to be BYOM (bring your own maintainers). We already had to put JSON Hyper-Schema on the back burner because we don't have the resources to maintain it right now. Adding another spec would just put us back in the same position. It would be your project that you lead and publish. I'm happy to follow along and give suggestions, but if I have 10 hours a week to spare, it will go into rebooting hyper-schema. |
Beta Was this translation helpful? Give feedback.
-
Related: OAI/OpenAPI-Specification#2542 Also related: I am working on clarifying what a core-only JSON Schema implementation looks like, which will help disentangle what parts of JSON Schema really must be present, what parts can be mixed and matched, and what possibilities that might open up. For example, I just delivered a (sadly private so I can't explain further) generative-only vocabulary for a client, that does not use any standard vocabulary other than core. Obviously, many if not most generative cases will want to share schemas with validation in a sort of bidirectional workflow, but there are a lot of possibilities that probably aren't obvious yet. |
Beta Was this translation helpful? Give feedback.
-
Also related: I've had users request the ability to generated c# data models from schemas, and I've found it's considerably more difficult to figure out than the other way around. It would be great to have a standard definition on how a schema should be interpreted to generate a model. One thing to be aware of: we need to consider both strongly- and loosely-typed languages as they have different capabilities. |
Beta Was this translation helpful? Give feedback.
-
I'm for this. As @jdesrosiers pointed out, this needs people to make it work, but not just any people, and I think you're (@jonaslagoni) aware of that. I think you're biggest challenge is going to be getting ANY level of time commitment from others. This has been my previous experience. I would love to be prooved wrong. I would suggest a slight alteration of your proposal, but it's mostly semantics.
My feeling is you will need at least 2 larger companies, and maybe 2-4 medium or smaller companies to at least agree in principal, and hopefully then commit to contribute or AT LEAST review and feedback at various points in your development. I'm happy for JSON Schema as an org to house, manage teams, guide and review work, and "stamp" a publication (whatever we decide that looks like). A good first step to this might be to jump on a call with @mkistler as he has been the most interested in a new vocabulary like this, and the most active in trying to make it happen. Jump on a call, see if you can agree on a possible process as above. Report back, and let's go from there. Sound reasonable? |
Beta Was this translation helpful? Give feedback.
-
@jonaslagoni @Relequestual I would suggest including @jdesrosiers along with @mkistler on any call. Mike is coming from a tooling background, while Jason understands the intent of what we've through through within the JSON Schema project already (e.g. the approach of disambiguating validation constructs, rather than creating new data modeling constructs or just forbidding a bunch of things). That will give you a balance of perspectives (as can be seen in the OAS issue that I linked above, where both comment). As also noted in the OAS issue, I would strongly suggest avoiding any thought of a "one true solution" vocabulary for code generation. You will need different features for different sorts of languages (strong or loosely typed, OO or functional). There will be things you could easily generate in Python or JavaScript that will be difficult or impossible in C++ or Java. JSON Schema draft 2020-12's modularity, where the |
Beta Was this translation helpful? Give feedback.
-
On the OAI call (2021-06-17) I heard there was a meeting of a special interest group. @jonaslagoni do you see that special interest group in OAI as separate from this effort, or are you OK for that to be the focus of activity? Either answer is fine. |
Beta Was this translation helpful? Give feedback.
-
@jonaslagoni Assuming the proposal to host the vocab proposal work in the JSON Schema org, do you want to propose a repo name? I wonder if the next step here is to try and define in and out of scope, kind of like a mini simplified charter. If you can agree on that, you'll have a basis to start this work collaborativly. |
Beta Was this translation helpful? Give feedback.
-
Just to align the thoughts, JSON Schema is for specifying validation rules that data should comply with and it should continue with that. This is perfect when you want to validate data, but what if you want to know the structure of the data? Cause as soon as you have valid data, you have structure and this underlying structure is what I refer to as the data model for the JSON Schema definition. One could see it as a side-effect to the specification.
The JSON Schema keywords, while simple on the surface, are complex beneath, and to truly understand how each keyword affects the underlying data model requires knowledge of the specification and how data is validated. However, even with that knowledge, there are still gaping holes that are up for interpretation.
Each organization (AsyncAPI, IBM, other tooling providers for OpenAPI, etc.) currently works in parallel solving the very same problems when it comes to using JSON Schema beyond validation in tooling. - and I think we should change that.
I think @jdesrosiers puts it perfectly in terms of what we have to achieve:
The specific suggestion
As I see it, it comes down to two core issues that need to be solved:
To me defining a code generation vocabulary cannot be done without solving the issue of how to interpret the validation rules.
What solving these issues should result in:
So, how do we solve it?
I suggest that it happens under a separate repository in the JSON Schema organization called (just gonna name something)
json-schema-data-model
alongside a GitHub team (datamodeling
?) with members that actively maintain and contribute to that project. (when do you "actively" maintain something? 🤔 Is that defined under the organization?)To get started the first issue in the repository should define the scope of the work in more detail so everyone agrees on what should be solved.
I suggest that the first team of maintainers are those who dedicate min x (10?) hours a week to kickstart the project. They should structure the work into GitHub milestones, splitting up the work into smaller chunks, what needs to be solved first, what can be done in parallel, etc.
This should be done somewhat separately from the core team working on the actual JSON Schema specification so it can continue to evolve. That being said, the involvement of the JSON Schema team is expected and should be the mediator and guide on this process.
Anyone should be able to jump in and contribute, but to slowly improve something we must start with something and the
datamodeling
team should move to provide as soon as possible.Scope of this discussion
Questions to spark the discussion
Beta Was this translation helpful? Give feedback.
All reactions