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

test: Use Ajv to test that api‑metadata.json matches schema #170

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ExE-Boss
Copy link
Contributor

@ExE-Boss ExE-Boss commented Jan 17, 2019

This adds a JSON Schema for api‑metadata.json and uses ajv and better‑ajv‑errors to validate api‑metadata.json against api‑metadata.schema.json.

review?(@Rob--W)

Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also paste examples of the output when schema validation fails?

That could even be encoded in the test, by knowingly passing an invalid API scheme to the validator, and asserting that the reported error matches with the expected error. In this way, we will know for sure that the schema validator is actually strictly enforcing the schema.

api-metadata.schema.json Outdated Show resolved Hide resolved
api-metadata.schema.json Show resolved Hide resolved
@ExE-Boss
Copy link
Contributor Author

/ping @Rob--W

Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote a comment but forgot to post it. Here it was:

api-metadata.schema.json Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

2 participants