Closed antmendoza closed 3 years ago
I noticed other validation failures with "oneof/required". For instance a valid Eventstate with not "transition" raises
[
{
instancePath: '',
schemaPath: '#/oneOf/1/required',
keyword: 'required',
params: { missingProperty: 'transition' },
message: "must have required property 'transition'"
},
{
instancePath: '',
schemaPath: '#/oneOf',
keyword: 'oneOf',
params: { passingSchemas: [Array] },
message: 'must match exactly one schema in oneOf'
}
]
I wonder if it's linked to the warnings:
unknown format "uri" ignored in schema at path "#/oneOf/0"
unknown format "uri" ignored in schema at path "#/oneOf/0"
unknown format "uri" ignored in schema at path "#/oneOf/0"
unknown format "uri" ignored in schema at path "#/oneOf/0"
unknown format "uri" ignored in schema at path "#/oneOf/0"
unknown format "uri" ignored in schema at path "#/oneOf/0"
unknown format "uri" ignored in schema at path "#/oneOf/0"
unknown format "uri" ignored in schema at path "#/oneOf/0"
unknown format "uri" ignored in schema at path "#/oneOf/0"
unknown format "uri" ignored in schema at path "#/oneOf/0"
unknown format "uri" ignored in schema at path "#/oneOf/0"
unknown format "uri" ignored in schema at path "#/oneOf/0"
I think that removing duplications in the json schema fix this error
see https://github.com/serverlessworkflow/specification/pull/381
I had a look to "conditional subschemas" https://json-schema.org/understanding-json-schema/reference/conditionals.html, apparently if the evaluated property has no value the condition is evaluated as true.
I think that removing duplications in the json schema fix this error
I had that impression indeed but didn't have time to investigate yet.
I had a look to "conditional subschemas" https://json-schema.org/understanding-json-schema/reference/conditionals.html, apparently if the evaluated property has no value the condition is evaluated as true.
You are right, the doc says that exactly. So this issue isn't one (or at least not in the realm of the SDK), the validation seems to work as it should. At the specification level though, we might want to add "required": ["usedForCompensation"]
to the if
.
@JBBianchi
why this has change the label to wontfix ?
Because this is not an issue, is it ? The validation works as the specification says it should. If there is a fix to be made, it would be at the schema level. Am I missing something?
still is something that need to be fixed
"Fixed" not really as it does what it's supposed to. But the default values in general needs to be addresses indeed. More generic version of the issue: #104
updated the json schema resolve this.
https://github.com/serverlessworkflow/specification/pull/406 https://github.com/serverlessworkflow/specification/pull/385
I suppose that this is an issue in the library we are using to validate object, (I will check the open issues tomorrow)
What happened:
foreachstateValidator is not working well when required files are based on
if..then..else..
conditionsWhat you expected to happen:
According to the specification, foreachstate with
"name", "type", "inputCollection", "iterationParam", "actions", "end"
is a valid object
How to reproduce it:
The code below
that generated the following object (a valid one)
fails with the following error
Anything else we need to know?:
adding to the object construction
.usedForCompensation(false)
works fine.Environment: