-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Runtime execution over missing fields when field is optional #197
Comments
Status: both serializations now work in Ergo. This leaves the questions about how we present the data model: (serialization/deserialization) to users for:
So in effect Ergo takes the interpretation that the data model is a field containing either I would love it if we could align the interpretation (changing that in Ergo is rather non-trivial, so my preference would be to switch the interpretation in Concerto). I am moving this discussion to the Concerto repo. |
@dselman @mttrbrts Would love to have your thoughts on this issue. I would love to sneak in this change into Concerto 1.0. Concretely the change would be, for the Concerto model:
Current behaviour:
New behaviour:
Some beliefs:
|
If I’ve understood the proposal, you’d like all optionals to be serialised as ‘null’ when absent in the JSON? Some questions:
|
Hm.. interesting questions.
|
This makes me think we could revisit this / leaves this open until we have a better idea of the "functional validation" change. |
The current JavaScript backend code generation expects JSON with a field containing
null
for optional fields in the CTO model.So for a concept:
The expected serialization is currently:
This is inconsistent with the way Concerto validates optional fields, instead assuming the default serialization is:
It would be useful to support both serialization in Ergo.
Note that it might be less confusing to Ergo user is the default Concerto serialization use the
null
form, since in Ergo, you always have to write:The text was updated successfully, but these errors were encountered: