Jsonapi
This module should reproduce JSON API v1.0 https://jsonapi.org/format/1.0/
Attributes (BaseModel)
pydantic-model
¶
Members of the attributes object ("attributes") represent information about the resource object in which it's defined. The keys for Attributes MUST NOT be: relationships links id type
BaseResource (BaseModel)
pydantic-model
¶
Error (BaseModel)
pydantic-model
¶
An error response
code: str
pydantic-field
¶
an application-specific error code, expressed as a string value.
detail: str
pydantic-field
¶
A human-readable explanation specific to this occurrence of the problem.
id: str
pydantic-field
¶
A unique identifier for this particular occurrence of the problem.
links: ErrorLinks
pydantic-field
¶
A links object storing about
meta: Meta
pydantic-field
¶
a meta object containing non-standard meta-information about the error.
source: ErrorSource
pydantic-field
¶
An object containing references to the source of the error
status: str
pydantic-field
¶
the HTTP status code applicable to this problem, expressed as a string value.
title: str
pydantic-field
¶
A short, human-readable summary of the problem. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
__hash__(self)
special
¶
Return hash(self).
Source code in optimade/models/jsonapi.py
def __hash__(self):
return hash(self.json())
ErrorLinks (BaseModel)
pydantic-model
¶
A Links object specific to Error objects
about: Union[pydantic.networks.AnyUrl, optimade.models.jsonapi.Link]
pydantic-field
¶
A link that leads to further details about this particular occurrence of the problem.
ErrorSource (BaseModel)
pydantic-model
¶
an object containing references to the source of the error
JsonApi (BaseModel)
pydantic-model
¶
Link (BaseModel)
pydantic-model
¶
Meta (BaseModel)
pydantic-model
¶
Non-standard meta-information that can not be represented as an attribute or relationship.
Relationship (BaseModel)
pydantic-model
¶
Representation references from the resource object in which it’s defined to other resource objects.
data: Union[optimade.models.jsonapi.BaseResource, List[optimade.models.jsonapi.BaseResource]]
pydantic-field
¶
Resource linkage
links: RelationshipLinks
pydantic-field
¶
a links object containing at least one of the following: self, related
meta: Meta
pydantic-field
¶
a meta object that contains non-standard meta-information about the relationship.
RelationshipLinks (BaseModel)
pydantic-model
¶
A resource object MAY contain references to other resource objects ("relationships"). Relationships may be to-one or to-many. Relationships can be specified by including a member in a resource's links object.
Relationships (BaseModel)
pydantic-model
¶
Members of the relationships object ("relationships") represent references from the resource object in which it's defined to other resource objects. Keys MUST NOT be: type id
Resource (BaseResource)
pydantic-model
¶
Resource objects appear in a JSON:API document to represent resources.
attributes: Attributes
pydantic-field
¶
an attributes object representing some of the resource’s data.
links: ResourceLinks
pydantic-field
¶
a links object containing links related to the resource.
meta: Meta
pydantic-field
¶
a meta object containing non-standard meta-information about a resource that can not be represented as an attribute or relationship.
relationships: Relationships
pydantic-field
¶
a relationships object describing relationships between the resource and other JSON:API resources.
ResourceLinks (BaseModel)
pydantic-model
¶
A Resource Links object
self: Union[pydantic.networks.AnyUrl, optimade.models.jsonapi.Link]
pydantic-field
¶
A link that identifies the resource represented by the resource object.
Response (BaseModel)
pydantic-model
¶
A top-level response
data: Union[NoneType, optimade.models.jsonapi.Resource, List[optimade.models.jsonapi.Resource]]
pydantic-field
¶
Outputted Data
errors: List[optimade.models.jsonapi.Error]
pydantic-field
¶
A list of unique errors
included: List[optimade.models.jsonapi.Resource]
pydantic-field
¶
A list of unique included resources
jsonapi: JsonApi
pydantic-field
¶
Information about the JSON API used
links: ToplevelLinks
pydantic-field
¶
Links associated with the primary data or errors
meta: Meta
pydantic-field
¶
A meta object containing non-standard information related to the Success
__json_encoder__(obj)
special
staticmethod
¶
partial(func, args, *keywords) - new function with partial application of the given arguments and keywords.
ToplevelLinks (BaseModel)
pydantic-model
¶
A set of Links objects, possibly including pagination
first: AnyUrl
pydantic-field
¶
The first page of data
last: AnyUrl
pydantic-field
¶
The last page of data
next: AnyUrl
pydantic-field
¶
The next page of data
prev: AnyUrl
pydantic-field
¶
The previous page of data
related: Union[pydantic.networks.AnyUrl, optimade.models.jsonapi.Link]
pydantic-field
¶
A related resource link
self: Union[pydantic.networks.AnyUrl, optimade.models.jsonapi.Link]
pydantic-field
¶
A link to itself