forked from canonical/snapd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aspects: support alternative types in schemas (canonical#13502)
* aspects: support alternative types in schemas Add support for defining a JSON list of alternative types (can be simple types or map-like types with constraints) that a schema should allow. Signed-off-by: Miguel Pires <[email protected]> * aspects: refactor schema parsing Refactor the parsing of a type to be more explicit about what kinds of definitions are allowed (map, string and list). Add test coverage for a some missing error cases. Signed-off-by: Miguel Pires <[email protected]> * aspects: make alternatives just Schema, not parser Signed-off-by: Miguel Pires <[email protected]> * aspects: rephrase validation errors Signed-off-by: Miguel Pires <[email protected]> * aspects: test fix Signed-off-by: Miguel Pires <[email protected]> * aspects: move methods under parse Signed-off-by: Miguel Pires <[email protected]> * aspects: flatten alternatives list Signed-off-by: Miguel Pires <[email protected]> * aspects: add prefix to error for clarity Signed-off-by: Miguel Pires <[email protected]> * aspects: improve err message Signed-off-by: Miguel Pires <[email protected]> --------- Signed-off-by: Miguel Pires <[email protected]>
- Loading branch information
1 parent
e016f71
commit e42aa42
Showing
2 changed files
with
360 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.