Skip to content

Commit

Permalink
specs-go: clarify mediatypes
Browse files Browse the repository at this point in the history
Due to the conflicting use of the `mediatType` field across
documents, and after discussion on
opencontainers#411,
this changeset removes the use of `mediaType` where it is used to refers
to a document's own type. Leaving only the use of `mediaType` for
descriptors, where it is used to describe the type of a referenced object.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
  • Loading branch information
vbatts committed Dec 9, 2016
1 parent 656fb2f commit e517a60
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions specs-go/v1/config.go
Expand Up @@ -78,6 +78,7 @@ type History struct {
}

// Image is the JSON structure which describes some basic information about the image.
// This provides the `application/vnd.oci.image.config.v1+json` mediatype when marshalled to JSON.
type Image struct {
// Created defines an ISO-8601 formatted combined date and time at which the image was created.
Created string `json:"created,omitempty"`
Expand Down
5 changes: 3 additions & 2 deletions specs-go/v1/descriptor.go
Expand Up @@ -15,9 +15,10 @@
package v1

// Descriptor describes the disposition of targeted content.
// This structure provides `application/vnd.oci.descriptor.v1+json` mediatype when marshalled to JSON
type Descriptor struct {
// MediaType contains the MIME type of the referenced object.
MediaType string `json:"mediaType"`
// MediaType is the media type of the object this schema refers to.
MediaType string `json:"mediaType,omitempty"`

// Digest is the digest of the targeted content.
Digest string `json:"digest"`
Expand Down
2 changes: 1 addition & 1 deletion specs-go/v1/manifest.go
Expand Up @@ -16,7 +16,7 @@ package v1

import "github.com/opencontainers/image-spec/specs-go"

// Manifest defines a schema2 manifest
// Manifest provides `application/vnd.oci.image.manifest.list.v1+json` mediatype structure when marshalled to JSON.
type Manifest struct {
specs.Versioned

Expand Down
3 changes: 2 additions & 1 deletion specs-go/v1/manifest_list.go
Expand Up @@ -50,7 +50,8 @@ type ManifestDescriptor struct {
Platform Platform `json:"platform"`
}

// ManifestList references manifests for various platforms.
// ManifestList references manifests for various platforms.
// This structure provides `application/vnd.oci.image.manifest.list.v1+json` mediatype when marshalled to JSON.
type ManifestList struct {
specs.Versioned

Expand Down
3 changes: 0 additions & 3 deletions specs-go/versioned.go
Expand Up @@ -20,7 +20,4 @@ package specs
type Versioned struct {
// SchemaVersion is the image manifest schema that this image follows
SchemaVersion int `json:"schemaVersion"`

// MediaType is the media type of this schema.
MediaType string `json:"mediaType"`
}

0 comments on commit e517a60

Please sign in to comment.