-
Notifications
You must be signed in to change notification settings - Fork 294
Snap doesn't return error on invalid task file #1157
Comments
@thomastaylor312: You are talking about the Publish not being a list correct? (It took me a few to notice). I wonder if that's json marshaling not returning an error or if we are ignoring it? |
Yes, and it also happened when my publish was outside of the |
Sorry, I meant that the |
@IRCody The invalid task manifest is valid JSON, it is just an invalid task manifest |
@thomastaylor312: Even if it's validJSON marshaling it into the task object should fail I think. I will try to look into it. |
Unless specific code is written to validate the task manifest sections, |
@geauxvirtual: Thanks! That would explain the behavior then I think then. It matches what we are seeing where the task is created with only the portion of the task manifest that maps correctly to something in the task struct. I'm not sure the best way to fix it though, even with custom unmarshal there are limits to what you can check for I think. |
I can put something together tomorrow as this ties into my work on #1130.
|
In the current code I'm working on, I have this being outputted as an error message with the invalid task manifest supplied up above.
|
Fix #1157: Check for unsupported keys in task manifests
When creating a task from a JSON file, Snap ignores invalid configuration
Bad config file:
When you create the task, it creates successfully with the following output from
snapctl task export
:It appears that snap ignored the invalid parts of the workflow instead of erroring on creation. This is tested against the latest master
The text was updated successfully, but these errors were encountered: