You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I've encountered a somewhat strange behaviour in oal, which to me looks like a bug. When annotating property declarations, I'm only able to use inline annotations, and not line (above) annotations.
It's clearer with some examples.
The following Oxlip code:
let id = 'id int `title: my title, description: my description`;
res /test on get -> { id };
produces (some fields omitted for brevity):
schema:
type: objectproperties:
id:
title: my titledescription: my descriptiontype: integer
On the other hand, this other Oxlip code:
# title: my title
# description: my description
let id = 'id int;
res /test on get -> { id };
produces:
schema:
type: objectproperties:
id:
type: integer
Note that there are no title or description keys.
I'm guessing that this is because in the first example the annotations get assigned to the "implicit" int type, while in the second case they get assigned to the property and discarded, for some reason.
I'm inclined to think this is what's happening also because given this Oxlip code:
# title: my title
let idType = int;
# description: this is going to get discarded
let id = 'id idType;
res /test on get -> { id };
I get:
schema:
type: objectproperties:
id:
title: my titletype: integer
Hi! I've encountered a somewhat strange behaviour in oal, which to me looks like a bug. When annotating property declarations, I'm only able to use inline annotations, and not line (above) annotations.
It's clearer with some examples.
The following Oxlip code:
produces (some fields omitted for brevity):
On the other hand, this other Oxlip code:
produces:
Note that there are no title or description keys.
I'm guessing that this is because in the first example the annotations get assigned to the "implicit" int type, while in the second case they get assigned to the property and discarded, for some reason.
I'm inclined to think this is what's happening also because given this Oxlip code:
I get:
As you can see, the description is discarded.
Note that this also seems to contradict the example at https://www.oxlip-lang.org/doc/overview.html#properties, where a description is added to a property declaration like above.
For completeness, the following Oxlip code works as intended:
as it produces:
The text was updated successfully, but these errors were encountered: