Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best practices for CI/CD testing of JSON schema files #524

Closed
kdaily opened this issue Oct 10, 2019 · 6 comments
Closed

Best practices for CI/CD testing of JSON schema files #524

kdaily opened this issue Oct 10, 2019 · 6 comments

Comments

@kdaily
Copy link
Contributor

kdaily commented Oct 10, 2019

Starting a discussion around best practices for CI/CD-related issues on schema files. I've enabled Travis on one of my schema repositories, and am only currently linting (using the same original definition as done in this repo).

What are some other things that we should be doing? What are the options for writing tests?

@karawoo
Copy link
Contributor

karawoo commented Oct 10, 2019

Good question @kdaily. Assuming you are talking about JSON Schemas (and not schema.org schemas or the current synapse annotations schema format), the first thing that leaps to mind is validating the schema against its meta-schema.

@kdaily kdaily changed the title Best practices for CI/CD testing of schema files Best practices for CI/CD testing of JSON schema files Oct 10, 2019
@kdaily
Copy link
Contributor Author

kdaily commented Oct 10, 2019

Thanks for the clarifying question. Correct, I do mean JSON schemas. As an example, this one for VEO-IBD generated by myself and @cw-dvr8. In this case, I don't think there is a meta-schema, as we authored this directly?

@karawoo
Copy link
Contributor

karawoo commented Oct 10, 2019

I meant validating it against the draft-07 (or whichever draft you're using) JSON Schema specification, to ensure that it is a valid schema.

@kdaily
Copy link
Contributor Author

kdaily commented Oct 10, 2019

Got it! Good suggestion. I tried doing this using ajv compile but my schema has remote references, which isn't supported in the ajv CLI tool. :(

@karawoo
Copy link
Contributor

karawoo commented Oct 10, 2019

Ah that is a big bummer. I wonder if we could get a contribution in to ajv-cli...

@kdaily
Copy link
Contributor Author

kdaily commented Oct 10, 2019

It's an old issue (2017):

ajv-validator/ajv-cli#29

@karawoo karawoo closed this as completed Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants