StackStorm / StackStorm/orquesta
combined schema (anyOf, allOf, oneOf) error message enhancement
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 111
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Description
I think this goes here, but if it goes on StackStorm/st2, I can file the issue there.
This issue is about improving the error message returned when a schema validation error occurs due to not matching a oneOf schema.
I ran an orquesta workflow and for the task transition I used the incorrect:
publish:
message: foobar
instead of the correct:
publish:
- message: foobar
Doing that gave me an error message like:
{
"spec_path": "tasks.validate_input.next[0].publish",
"message": "{'error_message': 'wrong format for input param foobar: {{ ctx().foobar }}'} is not valid under any of the given schemas",
"type": "syntax",
"schema_path": "properties.tasks.patternProperties.^\\w+$.properties.next.items.properties.publish.oneOf"
},
Then, I went to look up the schema to figure out what I did wrong, mistakenly guessing that it didn't like my use of Jinja. My error was passing in a dict instead of an array. Could the error message be improved to say what the options are when the schemaPath is oneOf? (in this case string or array of unique one item dicts)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported orquesta task transition with publish set to a dict instead of an array, then trace the schema validation error where the schema path ends in oneOf. Done means the error explains the accepted string or array-of-dicts alternatives for this invalid value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100