From 8ba398edecf4c850410d6ad52d9144352cf7abb9 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Wed, 14 Jun 2023 20:42:36 +0200 Subject: [PATCH] Clarify usage of links objects vs links --- optimade.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/optimade.rst b/optimade.rst index 2947c3fcf..a32b36e14 100644 --- a/optimade.rst +++ b/optimade.rst @@ -489,10 +489,10 @@ Every response SHOULD contain the following fields, and MUST contain at least :f :field:`meta` SHOULD also include these fields: - - **schema**: a `JSON API links object `__ that points to a schema for the response. + - **schema**: a `JSON API link `__ that points to a schema for the response. If it is a string, or a dictionary containing no :field:`meta` field, the provided URL MUST point at an `OpenAPI `__ schema. It is possible that future versions of this specification allows for alternative schema types. - Hence, if the :field:`meta` field of the JSON API links object is provided and contains a field :field:`schema_type` that is not equal to the string :field-val:`OpenAPI` the client MUST not handle failures to parse the schema or to validate the response against the schema as errors. + Hence, if a :field:`meta` field is provided for the link and contains a field :field:`schema_type` that is not equal to the string :field-val:`OpenAPI` the client MUST not handle failures to parse the schema or to validate the response against the schema as errors. - **time\_stamp**: a timestamp containing the date and time at which the query was executed. - **data\_returned**: an integer containing the total number of data resource objects returned for the current :query-param:`filter` query, independent of pagination. @@ -505,7 +505,7 @@ Every response SHOULD contain the following fields, and MUST contain at least :f :field:`provider` MAY include these fields: - - **homepage**: a `JSON API links object `__, pointing to the homepage of the database provider, either directly as a string, or as a link object which can contain the following fields: + - **homepage**: a `JSON API link `__, pointing to the homepage of the database provider, either directly as a string, or as an object which can contain the following fields: - **href**: a string containing the homepage URL. - **meta**: a meta object containing non-standard meta-information about the database provider's homepage. @@ -523,13 +523,13 @@ Every response SHOULD contain the following fields, and MUST contain at least :f - **name**: name of the implementation. - **version**: version string of the current implementation. - - **homepage**: a `JSON API links object `__, pointing to the homepage of the implementation. - - **source\_url**: a `JSON API links object `__ pointing to the implementation source, either downloadable archive or version control system. + - **homepage**: a `JSON API link `__, pointing to the homepage of the implementation. + - **source\_url**: a `JSON API link `__ pointing to the implementation source, either downloadable archive or version control system. - **maintainer**: a dictionary providing details about the maintainer of the implementation, MUST contain the single field: - **email** with the maintainer's email address. - - **issue\_tracker**: a `JSON API links object `__ pointing to the implementation's issue tracker. + - **issue\_tracker**: a `JSON API link `__ pointing to the implementation's issue tracker. - **warnings**: a list of warning resource objects representing non-critical errors or warnings. A warning resource object is defined similarly to a `JSON API error object `__, but MUST also include the field :field:`type`, which MUST have the value :field-val:`"warning"`. @@ -595,7 +595,7 @@ Every response SHOULD contain the following fields, and MUST contain at least :f The response MAY also return resources related to the primary data in the field: -- **links**: `JSON API links `__ is REQUIRED for implementing pagination. +- **links**: a `JSON API links object `__ is REQUIRED for implementing pagination. (see section `Entry Listing URL Query Parameters`_.) Each field of a links object, i.e., a "link", MUST be one of: @@ -1045,7 +1045,7 @@ The single resource object's response dictionary MUST include the following fiel - **formats**: List of available output formats. - **entry\_types\_by\_format**: Available entry endpoints as a function of output formats. - **available\_endpoints**: List of available endpoints (i.e., the string to be appended to the versioned or unversioned base URL serving the API). - - **license**: A `JSON API links object `__ giving a URL to a web page containing a human-readable text describing the license (or licensing options if there are multiple) covering all the data and metadata provided by this database. + - **license**: A `JSON API link `__ giving a URL to a web page containing a human-readable text describing the license (or licensing options if there are multiple) covering all the data and metadata provided by this database. Clients are advised not to try automated parsing of this link or its content, but rather rely on the field :field:`available_licenses` instead. Example: :field-val:`https://example.com/licenses/example_license.html`. @@ -1322,12 +1322,12 @@ The resource objects' response dictionaries MUST include the following fields: - **name**: Human-readable name for the OPTIMADE API implementation, e.g., for use in clients to show the name to the end-user. - **description**: Human-readable description for the OPTIMADE API implementation, e.g., for use in clients to show a description to the end-user. - - **base\_url**: `JSON API links object `__, pointing to the base URL for this implementation, either directly as a string, or as a links object, which can contain the following fields: + - **base\_url**: `JSON API link `__, pointing to the base URL for this implementation, either directly as a string, or as an object, which can contain the following fields: - **href**: a string containing the OPTIMADE base URL. - **meta**: a meta object containing non-standard meta-information about the implementation. - - **homepage**: `JSON API links object `__, pointing to a homepage URL for this implementation, either directly as a string, or as a links object, which can contain the following fields: + - **homepage**: a `JSON API link `__, pointing to a homepage URL for this implementation, either directly as a string, or as an object, which can contain the following fields: - **href**: a string containing the implementation homepage URL. - **meta**: a meta object containing non-standard meta-information about the homepage.