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

minItems = 1 #176

Closed
gdbassett opened this issue Sep 15, 2017 · 2 comments
Closed

minItems = 1 #176

gdbassett opened this issue Sep 15, 2017 · 2 comments

Comments

@gdbassett
Copy link
Contributor

Multiple enumerations have minItems=1 that don't need to. For example:
plus.IOC
impact.LOSS
actor.external.region
actor.external.name
actor.partner.region
(there probably should be a victim.partner.name)
victim.victim_id
victim.region

@gdbassett
Copy link
Contributor Author

Ok, this is an interesting one. I believe the intent was that by adding a minitems=1, if the object exists, at least one thing needs to be in it. I agree with this, however it is causing practical issues with https://github.com/mozilla-services/react-jsonschema-form though rjsf-team/react-jsonschema-form#675 may fix it.

That said, if it doesn't, it's probably better to set minitems=0. It will cause the items to not be created under optional objects. While it would now allow empty lists or objects to successfully validate, verisr::json2veris() will ignore them them on import.

Current plan: Try updating react-jsonschema-form in Veris webapp.

@gdbassett
Copy link
Contributor Author

I think this is fixed by Andy's script to pair down empty objects in the json before validation. Going to mark wont-fix and close though could be reopened if it causes future issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant