-
Notifications
You must be signed in to change notification settings - Fork 61
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
JSON schema doesn't have link objects validations for Eiffel events #148
Comments
Hi! Sorry for the late reply - I've been on vacation. I have given this issue some thought myself. Schema validation of links would be great, but it's easier said than done. As you indicate, there are two types of checks that can be made:
The first would be very valuable, but I'm uncertain whether it can be done with JSON schema. Perhaps using oneOf? If I get the time I'll try it out... The second is easily done, but unfortunately it shuts down the protocol. Additional link types should not be prohibited. If I wish to extend the protocol by defining my own DanielsCandyFlossCreatedEvent and want to reference it from other events using a CANDY_FLOSS link type, then that's perfectly fine. The current PR to this issue disallows that, though. |
My mistake. The keyword I was thinking of was "contains", not "oneOf". I'll play around a bit and see if I can make something work. |
Unfortunately the current version of jsonschema doesn't support draft 6 (where "contains" is introduced). See python-jsonschema/jsonschema#337 I tried working around this with the following:
Problem is I can't make that work for multiple required types (consider EiffelArtifactReusedEvent, which requires REUSED_ARTIFACT and COMPOSITION). Perhaps there's a way that I just don't see? Otherwise, I suggest we put this on hold and revisit it when jsonschema support draft 6. What we easily can do, however, is to support validation of UUID syntax in links. I think I'll make a PR to that effect... |
This is related to #136, by the way. |
Quick update: still no draft6 support :( Would be neat if we could contribute to jsonschema to help fix that, but the time can be found right now. |
AFAICT draft 6 support is available now so it should be possible to start working on this issue. |
Thanks. We will look into it. |
This issue is now considered solved thanks to #380 . That PR only covers the aspect of validating the existence of mandatory link types. The schema does not validate that all provided link types are valid. |
From https://github.com/Ericsson/eiffel/blob/master/eiffel-syntax-and-usage/the-links-object.md,
we notice that few links are specific to Few Eiffel Events,
For Example: EiffelActivityCanceledEvent
Required : ACTIVITY_EXECUTION
Optional : CAUSE/CONTEXT, FLOW_CONTEXT
Today in schema there is no validation on the type field in links array object. We have tried to cover half of this (Few Links specific to Few events) in this pull request #147.
We did not find ways in which we can cover mandatory and optional links without hardcoding the links in each event instead of type and value.
The text was updated successfully, but these errors were encountered: