Skip to content

Commit

Permalink
Merge pull request #474 from Materials-Consortia/ml-evs/clarify-links…
Browse files Browse the repository at this point in the history
…-object

Clarify usage of links objects vs links
  • Loading branch information
rartino authored Jun 15, 2023
2 parents 675bffe + 8ba398e commit 6130f11
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions optimade.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://jsonapi.org/format/1.0/#document-links>`__ that points to a schema for the response.
- **schema**: a `JSON API link <http://jsonapi.org/format/1.0/#document-links>`__ 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 <https://swagger.io/specification/>`__ 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.
Expand All @@ -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 <http://jsonapi.org/format/1.0/#document-links>`__, 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 <http://jsonapi.org/format/1.0/#document-links>`__, 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.
Expand All @@ -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 <http://jsonapi.org/format/1.0/#document-links>`__, pointing to the homepage of the implementation.
- **source\_url**: a `JSON API links object <http://jsonapi.org/format/1.0/#document-links>`__ pointing to the implementation source, either downloadable archive or version control system.
- **homepage**: a `JSON API link <http://jsonapi.org/format/1.0/#document-links>`__, pointing to the homepage of the implementation.
- **source\_url**: a `JSON API link <http://jsonapi.org/format/1.0/#document-links>`__ 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 <http://jsonapi.org/format/1.0/#document-links>`__ pointing to the implementation's issue tracker.
- **issue\_tracker**: a `JSON API link <http://jsonapi.org/format/1.0/#document-links>`__ 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 <http://jsonapi.org/format/1.0/#error-objects>`__, but MUST also include the field :field:`type`, which MUST have the value :field-val:`"warning"`.
Expand Down Expand Up @@ -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 <http://jsonapi.org/format/1.0/#document-links>`__ is REQUIRED for implementing pagination.
- **links**: a `JSON API links object <http://jsonapi.org/format/1.0/#document-links>`__ 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:

Expand Down Expand Up @@ -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 <http://jsonapi.org/format/1.0/#document-links>`__ 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 <http://jsonapi.org/format/1.0/#document-links>`__ 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`.

Expand Down Expand Up @@ -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 <http://jsonapi.org/format/1.0/#document-links>`__, 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 <http://jsonapi.org/format/1.0/#document-links>`__, 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 <http://jsonapi.org/format/1.0/#document-links>`__, 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 <http://jsonapi.org/format/1.0/#document-links>`__, 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.
Expand Down

0 comments on commit 6130f11

Please sign in to comment.