diff --git a/CHANGELOG.md b/CHANGELOG.md index 793971d6..e3e09c9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - The `keywords` field known from Collections is available in common metadata. ([#1187](https://github.com/radiantearth/stac-spec/issues/1187)) +- New fields `method`, `headers` and `body` in the Link Object. ([#1198](https://github.com/radiantearth/stac-spec/issues/1198)) - The `license` field additionally supports SPDX expressions and the value `other`. - The `roles` field known from Assets and Providers is available in common metadata. ([#1267](https://github.com/radiantearth/stac-spec/issues/1267)) - Best practice: Link titles should exactly reflect the title of the corresponding entity ([#1168](https://github.com/radiantearth/stac-spec/issues/1168)) diff --git a/catalog-spec/catalog-spec.md b/catalog-spec/catalog-spec.md index c29e45ee..05486f9b 100644 --- a/catalog-spec/catalog-spec.md +++ b/catalog-spec/catalog-spec.md @@ -68,18 +68,7 @@ This must **not** declare the extensions that are only implemented in child Coll ### Link Object -This object describes a relationship with another entity. Data providers are advised to be liberal -with links. - -| Field Name | Type | Description | -| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| href | string | **REQUIRED.** The actual link in the format of an URL. Relative and absolute links are both allowed. [Trailing slashes are significant.](../best-practices.md#consistent-uris) | -| rel | string | **REQUIRED.** Relationship between the current document and the linked document. See chapter ["Relation types"](#relation-types) for more information. | -| type | string | [Media type](#media-types) of the referenced entity. | -| title | string | A human readable title to be used in rendered displays of the link. | - -For a full discussion of the situations where relative and absolute links are recommended see the -['Use of links'](../best-practices.md#use-of-links) section of the STAC best practices. +This object is described in the [STAC Common Metadata](../item-spec/common-metadata.md#link-object) section. #### Relation types diff --git a/collection-spec/collection-spec.md b/collection-spec/collection-spec.md index 76b56e25..cfd78f98 100644 --- a/collection-spec/collection-spec.md +++ b/collection-spec/collection-spec.md @@ -249,17 +249,7 @@ May also include information about the final storage provider hosting the data. ### Link Object -This object describes a relationship with another entity. Data providers are advised to be liberal with links. - -| Field Name | Type | Description | -| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| href | string | **REQUIRED.** The actual link in the format of an URL. Relative and absolute links are both allowed. [Trailing slashes are significant.](../best-practices.md#consistent-uris) | -| rel | string | **REQUIRED.** Relationship between the current document and the linked document. See chapter "[Relation types](#relation-types)" for more information. | -| type | string | [Media type](../catalog-spec/catalog-spec.md#media-types) of the referenced entity. | -| title | string | A human readable title to be used in rendered displays of the link. | - -For a full discussion of the situations where relative and absolute links are recommended see the -['Use of links'](../best-practices.md#use-of-links) section of the STAC best practices. +This object is described in the [STAC Common Metadata](../item-spec/common-metadata.md#link-object) section. #### Relation types diff --git a/item-spec/common-metadata.md b/item-spec/common-metadata.md index 1d54f8f9..e11acf33 100644 --- a/item-spec/common-metadata.md +++ b/item-spec/common-metadata.md @@ -21,6 +21,7 @@ or [Collection Asset](../collection-spec/collection-spec.md#asset-object). - [constellation](#constellation) - [mission](#mission) - [gsd](#gsd) + - [Link](#link-object) Various *examples* are available in the folder [`examples`](../examples/). *JSON Schemas* can be found in the folder [`json-schema`](json-schema/). @@ -212,3 +213,28 @@ optical and short-wave IR bands are all 30 meters, but the panchromatic band is PlanetScope Ortho Tile Product has an `gsd` of 3.7 (or 4 if rounding), even though the pixel size of the images is 3.125. For example, one might choose for WorldView-2 the Multispectral 20° off-nadir value of 2.07 and for WorldView-3 the Multispectral 20° off-nadir value of 1.38. + +### Link Object + +This object describes a relationship with another entity. Data providers are advised to be liberal +with the links section, to describe things like the Catalog an Item is in, related Items, parent or +child Items (modeled in different ways, like an 'acquisition' or derived data). + +| Field Name | Type | Description | +| ---------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| href | string | **REQUIRED.** The actual link in the format of an URL. Relative and absolute links are both allowed. [Trailing slashes are significant.](../best-practices.md#consistent-uris) | +| rel | string | **REQUIRED.** Relationship between the current document and the linked document. See chapter "Relation types" for more information. | +| type | string | Media type of the referenced entity. | +| title | string | A human readable title to be used in rendered displays of the link. | +| method | string | The HTTP method that shall be used for the request to the target resource, in uppercase. `GET` by default | +| headers | Map | The HTTP headers to be sent for the request to the target resource. | +| body | any | The HTTP body to be sent to the target resource. | + +For a full discussion of the situations where relative and absolute links are recommended see the +['Use of links'](../best-practices.md#use-of-links) section of the STAC best practices. + +#### HTTP headers + +The field `headers` allows to describe a dictionary of HTTP headers that are required to be sent by the client. +The keys of the dictionary are the header names, and the values are either a single string or an array of strings. +In case of an array, the header is expected to be sent multiple times with the different values. diff --git a/item-spec/item-spec.md b/item-spec/item-spec.md index 316ef193..3cf923d1 100644 --- a/item-spec/item-spec.md +++ b/item-spec/item-spec.md @@ -186,20 +186,7 @@ only be used when the data itself is nested, as with `eo:bands`. ### Link Object -This object describes a relationship with another entity. Data providers are advised to be liberal -with the links section, to describe things like the Catalog an Item is in, related Items, parent or -child Items (modeled in different ways, like an 'acquisition' or derived data). -It is allowed to add additional fields such as a `title` and `type`. - -| Field Name | Type | Description | -| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| href | string | **REQUIRED.** The actual link in the format of an URL. Relative and absolute links are both allowed. [Trailing slashes are significant.](../best-practices.md#consistent-uris) | -| rel | string | **REQUIRED.** Relationship between the current document and the linked document. See chapter "Relation types" for more information. | -| type | string | [Media type](../catalog-spec/catalog-spec.md#media-types) of the referenced entity. | -| title | string | A human readable title to be used in rendered displays of the link. | - -For a full discussion of the situations where relative and absolute links are recommended see the -['Use of links'](../best-practices.md#use-of-links) section of the STAC best practices. +This object is described in the [STAC Common Metadata](common-metadata.md#link-object) section. #### Relation types diff --git a/item-spec/json-schema/item.json b/item-spec/json-schema/item.json index ede4d62a..31ea52a2 100644 --- a/item-spec/json-schema/item.json +++ b/item-spec/json-schema/item.json @@ -203,6 +203,33 @@ "title": { "title": "Link title", "type": "string" + }, + "method": { + "title": "Link method", + "type": "string", + "pattern": "^[A-Z]+$", + "default": "GET" + }, + "headers": { + "title": "Link headers", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "body": { + "title": "Link body", + "$comment": "Any type is allowed." } } }, @@ -260,4 +287,4 @@ ] } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index e1d7ba9a..138a80ca 100644 --- a/package.json +++ b/package.json @@ -92,4 +92,4 @@ ] ] } -} \ No newline at end of file +}