Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion schema/defs-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@
"type": "boolean"
},
"type": {
"type": "string"
"type": "string",
"pattern": "^[acb]$"
Copy link
Member

@cyphar cyphar Oct 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct, you can have empty type fields (this is the default of both runtime-tools and runc). It should be ^[acb]?$.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be ^[acb]?$.

No, it's right without the ?. Empty-string values are not valid in the JSON. This property can be unset in JSON, which we cover inthe JSON Schema by not listing type in required. We test the unset-type case with this, via this and this.

In the non-pointer Go property, "unset" is not an option, but the omitempty means empty-string Go values are treated as unset for JSON Schema validation.

},
"major": {
"$ref": "#/definitions/Major"
Expand Down