Skip to content

Commit

Permalink
schema: urls optimization
Browse files Browse the repository at this point in the history
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
  • Loading branch information
zhouhao committed Mar 8, 2017
1 parent b36dbc4 commit 20ad7f7
Show file tree
Hide file tree
Showing 6 changed files with 10,956 additions and 9,802 deletions.
12 changes: 4 additions & 8 deletions schema/content-descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,23 @@
"properties": {
"mediaType": {
"description": "the mediatype of the referenced object",
"$ref": "defs-image.json#/definitions/mediaType"
"$ref": "defs-descriptor.json#/definitions/mediaType"
},
"size": {
"description": "the size in bytes of the referenced object",
"$ref": "defs.json#/definitions/int64"
},
"digest": {
"description": "the cryptographic checksum digest of the object, in the pattern '<hash>:<hexadecimal digest>'",
"$ref": "defs-image.json#/definitions/digest"
"$ref": "defs-descriptor.json#/definitions/digest"
},
"urls": {
"description": "a list of urls from which this object may be downloaded",
"type": "array",
"items": {
"type": "string",
"format": "uri"
}
"$ref": "defs-descriptor.json#/definitions/urls"
},
"annotations": {
"id": "https://opencontainers.org/schema/image/descriptor/annotations",
"$ref": "defs-image.json#/definitions/annotations"
"$ref": "defs-descriptor.json#/definitions/annotations"
}
},
"required": [
Expand Down
34 changes: 34 additions & 0 deletions schema/defs-descriptor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"description": "Definitions particular to OpenContainer Descriptor Specification",
"definitions": {
"mediaType": {
"id": "https://opencontainers.org/schema/image/descriptor/mediaType",
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9!#$&-^_.+]{0,126}/[A-Za-z0-9][A-Za-z0-9!#$&-^_.+]{0,126}$"
},
"digest": {
"description": "the cryptographic checksum digest of the object, in the pattern '<hash>:<hexadecimal digest>'",
"type": "string",
"pattern": "^[a-z0-9_+.-]+:[a-f0-9]+$"
},
"urls": {
"description": "a list of urls from which this object may be downloaded",
"type": "array",
"items": {
"type": "string",
"format": "uri"
}
},
"annotations": {
"id": "https://opencontainers.org/schema/image/descriptor/annotations",
"oneOf": [
{
"$ref": "defs.json#/definitions/mapStringString"
},
{
"type": "null"
}
]
}
}
}
33 changes: 4 additions & 29 deletions schema/defs-image.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
{
"description": "Definitions particular to OpenContainer Image Specification",
"definitions": {
"mediaType": {
"id": "https://opencontainers.org/schema/image/mediaType",
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9!#$&-^_.+]{0,126}/[A-Za-z0-9][A-Za-z0-9!#$&-^_.+]{0,126}$"
},
"digest": {
"description": "the cryptographic checksum digest of the object, in the pattern '<hash>:<hexadecimal digest>'",
"type": "string",
"pattern": "^[a-z0-9_+.-]+:[a-f0-9]+$"
},
"manifestDescriptor": {
"id": "https://opencontainers.org/schema/image/manifestDescriptor",
"type": "object",
Expand All @@ -22,23 +12,19 @@
"properties": {
"mediaType": {
"description": "the mediatype of the referenced object",
"$ref": "#/definitions/mediaType"
"$ref": "defs-descriptor.json#/definitions/mediaType"
},
"size": {
"description": "the size in bytes of the referenced object",
"$ref": "defs.json#/definitions/int64"
},
"digest": {
"description": "the cryptographic checksum digest of the object, in the pattern '<hash>:<hexadecimal digest>'",
"$ref": "#/definitions/digest"
"$ref": "defs-descriptor.json#/definitions/digest"
},
"urls": {
"description": "a list of urls from which this object may be downloaded",
"type": "array",
"items": {
"type": "string",
"format": "uri"
}
"$ref": "defs-descriptor.json#/definitions/urls"
},
"platform": {
"id": "https://opencontainers.org/schema/image/platform",
Expand Down Expand Up @@ -80,20 +66,9 @@
},
"annotations": {
"id": "https://opencontainers.org/schema/image/descriptor/annotations",
"$ref": "#/definitions/annotations"
"$ref": "defs-descriptor.json#/definitions/annotations"
}
}
},
"annotations": {
"id": "https://opencontainers.org/schema/image/annotations",
"oneOf": [
{
"$ref": "defs.json#/definitions/mapStringString"
},
{
"type": "null"
}
]
}
}
}
Loading

0 comments on commit 20ad7f7

Please sign in to comment.