-
Notifications
You must be signed in to change notification settings - Fork 775
Bug Fix: error syntax in schema definitions #444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,14 +6,15 @@ | |
| "properties": { | ||
| "mediaType": { | ||
| "description": "the mediatype of the referenced object", | ||
| "$ref": "defs-image.json#definitions/mediaType" | ||
| "$ref": "defs-image.json#/definitions/mediaType" | ||
| }, | ||
| "size": { | ||
| "description": "the size in bytes of the referenced object", | ||
| "$ref": "defs.json#/definitions/int64" | ||
| }, | ||
| "digest": { | ||
| "$ref": "defs-image.json#definitions/digest" | ||
| "description": "the cryptographic checksum digest of the object, in the pattern '<hash>:<hexadecimal digest>'", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with “the digest of the object referenced object”, to match the existing
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I carry on the description from https://github.com/opencontainers/image-spec/blob/master/schema/defs-image.json#L10 directly. I think it had better to keep same words for one entry.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, fair enough. I can file a PR shooting for consistency between |
||
| "$ref": "defs-image.json#/definitions/digest" | ||
| }, | ||
| "urls": { | ||
| "description": "a list of urls from which this object may be downloaded", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| "mediaType": { | ||
| "id": "https://opencontainers.org/schema/image/mediaType", | ||
| "type": "string", | ||
| "pattern": "^[a-z]+/[0-9a-zA-Z.+]+$" | ||
| "pattern": "^[A-Za-z0-9][A-Za-z0-9!#$&-^_.+]{0,126}/[A-Za-z0-9][A-Za-z0-9!#$&-^_.+]{0,126}$" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should just do an enum here. Is there a way we can define an enum, then have callers of the validator add values to it as needed?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That change is cherry-picked from #448, which focuses on updating the I don't think an enum would work, because descriptors are generic. On the other hand, particular instances of descriptors may not be generic, and #404 is an example of using enums in those cases.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @stevvooe enum seems too strict, which will lead customized types failed during verifying. I checked |
||
| }, | ||
| "digest": { | ||
| "description": "the cryptographic checksum digest of the object, in the pattern '<hash>:<hexadecimal digest>'", | ||
|
|
@@ -23,14 +23,15 @@ | |
| "properties": { | ||
| "mediaType": { | ||
| "description": "the mediatype of the referenced object", | ||
| "$ref": "#definitions/mediaType" | ||
| "$ref": "#/definitions/mediaType" | ||
| }, | ||
| "size": { | ||
| "description": "the size in bytes of the referenced object", | ||
| "$ref": "defs.json#/definitions/int64" | ||
| }, | ||
| "digest": { | ||
| "$ref": "#definitions/digest" | ||
| "description": "the cryptographic checksum digest of the object, in the pattern '<hash>:<hexadecimal digest>'", | ||
| "$ref": "#/definitions/digest" | ||
| }, | ||
| "urls": { | ||
| "description": "a list of urls from which this object may be downloaded", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to this. Backing docs in RFC 6901 and the current JSON Schema draft.