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

"toMatchGraphObjectSchema" generates an invalid JSON schema when using _class with duplicate "required" properties #293

Closed
austinkelleher opened this issue Aug 20, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@austinkelleher
Copy link
Contributor

The Disk class acts as an alias to the DataStore class, which means that they have duplicate required properties. Duplicate required properties in JSON schema is invalid as are duplicate property type's. We need to ensure that we deduplicate values in required and type.

Example:

const data = {
  _class: ['DataStore', 'Disk'],
 ...
}

toMatchGraphObjectSchema(data, {
  _class: ['DataStore', 'Disk'],
  ...
});

Throws the following error:

schema is invalid: data.required should NOT have duplicate items (items ## 13 and 6 are identical)
@austinkelleher austinkelleher added the bug Something isn't working label Aug 20, 2020
@austinkelleher austinkelleher self-assigned this Aug 20, 2020
austinkelleher added a commit that referenced this issue Aug 20, 2020
Fixes #293 - "toMatchGraphObjectSchema" generates an invalid JSON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant