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

Add in tests for JSON Schemas being produced #971

Closed
2 tasks
shimks opened this issue Feb 6, 2018 · 7 comments · Fixed by #1323
Closed
2 tasks

Add in tests for JSON Schemas being produced #971

shimks opened this issue Feb 6, 2018 · 7 comments · Fixed by #1323
Assignees
Milestone

Comments

@shimks
Copy link
Contributor

shimks commented Feb 6, 2018

Acceptance Criteria

  • write tests for types of JSON Schema in repository-json-schema
  • validate JSON Schemas produced in the tests of repository-json-schema with a JSON-Schema-validating-JSON Schema
@virkt25
Copy link
Contributor

virkt25 commented Feb 8, 2018

A list of packages we can use for validation:
http://json-schema.org/implementations.html#validator-javascript

@raymondfeng
Copy link
Contributor

https://github.com/epoberezkin/ajv

@rahulrkr08
Copy link
Contributor

@virkt25
Copy link
Contributor

virkt25 commented May 1, 2018

How is this different from #1294?

@virkt25 virkt25 removed their assignment May 1, 2018
@shimks
Copy link
Contributor Author

shimks commented May 1, 2018

@virkt25 #1294 is adding in validation for the purpose of validating parameters parsed from http requests. This one will be used to validate whether the JSON Schemas our packages produce are themselves valid JSON Schemas. The reason we should have this validation should be congruent to the reason we have openapi-v3 spec validator.

@b-admike b-admike removed their assignment May 1, 2018
@shimks
Copy link
Contributor Author

shimks commented May 1, 2018

Throwing back to have the acceptance criteria fleshed out: what is this extension geared towards? What is the UX? Is this an internal utility?

If internal: it should live in testlab, it should also be less restrictive

@bajtos
Copy link
Member

bajtos commented May 2, 2018

rovide a general validateJsonSchema function that returns a boolean based on whether the argument is a valid JSON Schema or not.

Returning a boolean is not helpful. When the document is not a valid JSON schema, then we need a descriptive list of spec violations, so that we know what to fix!

what is this extension geared towards? What is the UX? Is this an internal utility?

To be honest, I don't know. What was your intention when you opened this issue?

As I am thinking about this, maybe what we really want is to write few unit tests for repository-json-schema to verify that we are producing a proper JSON schema documents. If that's the case, then I think this issue/story should be renamed to reflect this intention. I also may not need any publicly-exposed JSON-schema validator in testlab, we can simply set up the validator in repository-json-schema tests only.

@shimks shimks changed the title Add in JSON Schema validator Add in tests for JSON Schemas being produced May 2, 2018
@shimks shimks self-assigned this May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants