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

Validator: A ScheduledSession must be a subEvent of another Event. #96

Open
drinkynet opened this issue May 6, 2022 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@drinkynet
Copy link
Contributor

Might be worth the library throwing a RuntimeException here so that the error can be picked up in development before using the validator.

@nathansalter
Copy link
Contributor

When would you throw the error? The event not having a parent event set is only really an error during serialization, but we don't have enough context in the serializer there to determine easily if the session property is set.

@nathansalter nathansalter added the enhancement New feature or request label Jun 1, 2022
@drinkynet
Copy link
Contributor Author

It would make sense to do it during serialisation as that is the exact point it should all be valid. Otherwise you'd be wrongly throwing exceptions while building up the model.

I suppose you'd need some pre-serialisation validation method/rule on the model that the serialiser could be aware of to call. But I guess we're into quite a bit of complexity for a little bit of convenience here, and maybe catching it in the validator is fine :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants