Closed kinlane closed 3 years ago
@kinlane I'm not clear on the difference between this JSON schema you're working on vs the "model definitions" which are already part of the OpenAPI definition file and lay out the data types being exchanged. Can you help me understand? Thanks!
@kinlane also you have an older topic with a very similar introductory post that I'm too lazy to look up now after going through nearly all of them methodically. ;-)
All the information you need regarding JSON Schema is here - http://json-schema.org/
When I find the time to finish this project, I will be writing up blog post that covers.
The definitions portion of OpenAPI is JSON Schema, so I have been creating a representation for HSDS (which is the definitions) in the HSDA OpenAPI.
The HSDA validator is an API that accepts a JSON Body, and validates it against the JSON schema I give it. The JSON could be:
So, I've done the work on creating:
I'm still working on:
I've struggled with it being a boolean decision (yes/no) or % complete validation.
I've stopped worked on because of the discussion leading up to #45 /complete, because it changes the schema, forcing me to redo work.
Also I'm struggling because the OpenAPI usage of JSON schema isn't complete, and I'm missing some operators to handle validation. Some of this is coming in OpenAPI 3.0, but some I will have to handcode, and my JSON schema chops are only about 65% currently.
The validator is becoming it's own HSDA microservice, and will be versioned and evolved on it's own. It depends on the JSON schema in the OpenAPI, and the JSON schema for the OpenAPI.
@kinlane Is the process of getting from HSDS datapackage.json -> jsonschema documented anywhere?
On validation, it's worth separating out a couple of different concepts we find:
Happy to work with you on exploring more how we can get a good approach to validation across HSDA and HSDS going.
I have not put HSDS datapackage.json into the road map. Will do.
Agreed on these three breakdown areas, and will be using as guide as I begin organizing the rules being entered in the JSON schema, and applied at validation time.
The Postman collection for HSDA is validated against the OpenAPI for HSDA core, and we'll adding contract test scripts to each request to test against the OpenAPI as a monitor on a schedule, or as part of the CI/CD pipeline -
I am working on a JSON schema for HSDS, and for HSDA.
I already have an API for validating an API path or JSON snippet against any JSON schema when ready. Will release as extra set of API paths.
Once schema are establish we will need to establish the set of rules being applied, and how strict we intend on being.