Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: items allows the presence of boolean schemas #115

Conversation

macisamuele
Copy link
Contributor

While working on https://github.com/macisamuele/jsonschema-equivalent I've noticed that having boolean schemas into items keyword result into an invalid schema, when instead it should be considered valid.

Example:

{
    "additionalItems": false,
    "items": true
}

is considered an invalid schema but according to the draft (section 6.4.1)

The value of "items" MUST be either a valid JSON Schema or an array of valid JSON Schemas.

and true or false are valid JSON Schemas.

The goal of this PR is to fix this.

PS: I'm aware that the example schema is unlikely to be composed by humans as it really is as restrictive as true schema, but it is still a possible valid schema.

@Stranger6667
Copy link
Owner

Hi @macisamuele !

Thanks! Will release a new version today :)

Copy link
Owner

@Stranger6667 Stranger6667 left a comment

Choose a reason for hiding this comment

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

Can you, please, add a changelog entry?

@macisamuele
Copy link
Contributor Author

Will release a new version today :)

Sure thing, in the mean time I'm trying to add more test coverage on the other project, so I can easily work with a patched crates.io ;)

Can you, please, add a changelog entry?

Doing it right now

@macisamuele macisamuele force-pushed the maci-allow-boolean-schemas-into-items-value branch from eccfbae to ff2a785 Compare June 21, 2020 15:51
@Stranger6667 Stranger6667 merged commit 1b5ce73 into Stranger6667:master Jun 21, 2020
@macisamuele macisamuele deleted the maci-allow-boolean-schemas-into-items-value branch June 21, 2020 16:28
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants