-
Notifications
You must be signed in to change notification settings - Fork 63
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
Make forms inherited from a base form #1319
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Note: I recommend ignoring whitespaces since the PR touches lots of them...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forms for property should point to form_element_property
while the definition of form_element_property
should have the "allOf" construct.
{
"allOf": [{ "$ref": "#/definitions/form_element_base" }],
"properties": {
"op": {
...
}
}
}
Moreover, form_element_base
might also need the op
values.. in this case defined as string ... with no enumerations. Thinking of it in an hierarchical fashion root/property/actions/events should be more specific.
I "believe" doing so it might work..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @danielpeintner having allOf inside form_element_property it is more self-contained.
Regarding ts typings it may be beneficial to have a generic Form type:
{
// schema ...
form : {
oneOf: [
{ $ref : "#/definitions/form_element_property" },
{ $ref : "#/definitions/form_element_action" },
{ $ref : "#/definitions/form_element_event" },
{ $ref : "#/definitions/form_element_root" },
]
}
}
Although this would not have any validation purposes, it should also solve: eclipse-thingweb/node-wot#550
Three points about the comments above:
Some other comments:
|
Call of 15.12.2021: |
start fixing tm schema tests
Converting to a draft since I have found some major issues with the tests. Basically none of the tests were working, now they do and reveal an issue with the regex.
I need to understand it properly before making it available |
I have learned that I have to encapsulate |
from today's TD call, decided to merge |
Addresses #1311
Some basic tests are available at https://www.jsonschemavalidator.net/s/lNpA9CYs