Server#
Misc#
JSON-RPC server package.
- class pjrpc.server.AsyncDispatcher(*, executor=None, json_loader=<function loads>, json_dumper=<function dumps>, json_encoder=<class 'pjrpc.server.dispatcher.JSONEncoder'>, json_decoder=None, middlewares=(), max_batch_size=None)[source]#
Bases:
BaseDispatcher,Generic[ContextType]Asynchronous method dispatcher.
- Parameters:
executor (Optional[AsyncExecutor]) –
json_encoder (type[pjrpc.server.dispatcher.JSONEncoder]) –
middlewares (Iterable[AsyncMiddlewareType[ContextType]]) –
- class pjrpc.server.AsyncMiddlewareType(*args, **kwargs)[source]#
Bases:
Protocol[ContextType]Asynchronous middleware type
- class pjrpc.server.BaseDispatcher(*, request_class=<class 'pjrpc.common.request.Request'>, response_class=<class 'pjrpc.common.response.Response'>, batch_request_class=<class 'pjrpc.common.request.BatchRequest'>, batch_response_class=<class 'pjrpc.common.response.BatchResponse'>, json_loader=<function loads>, json_dumper=<function dumps>, json_encoder=<class 'pjrpc.server.dispatcher.JSONEncoder'>, json_decoder=None, middlewares=())[source]#
Bases:
objectMethod dispatcher.
- Parameters:
request_class (type[pjrpc.common.request.Request]) – JSON-RPC request class
response_class (type[pjrpc.common.response.Response]) – JSON-RPC response class
batch_request_class (type[pjrpc.common.request.BatchRequest]) – JSON-RPC batch request class
batch_response_class (type[pjrpc.common.response.BatchResponse]) – JSON-RPC batch response class
json_encoder (type[pjrpc.server.dispatcher.JSONEncoder]) – response json encoder
json_decoder (Optional[type[json.decoder.JSONDecoder]]) – request json decoder
middlewares (Iterable[Callable[[...], Any]]) – request middlewares
- class pjrpc.server.Dispatcher(*, executor=None, json_loader=<function loads>, json_dumper=<function dumps>, json_encoder=<class 'pjrpc.server.dispatcher.JSONEncoder'>, json_decoder=None, middlewares=(), max_batch_size=None)[source]#
Bases:
BaseDispatcher,Generic[ContextType]Synchronous method dispatcher.
- Parameters:
executor (Optional[Executor]) –
json_encoder (type[pjrpc.server.dispatcher.JSONEncoder]) –
middlewares (Iterable[MiddlewareType[ContextType]]) –
- class pjrpc.server.JSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]#
Bases:
JSONEncoderServer JSON encoder. All custom server encoders should be inherited from it.
- default(o)[source]#
Implement this method in a subclass such that it returns a serializable object for
o, or calls the base implementation (to raise aTypeError).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return super().default(o)
- exception pjrpc.server.JsonRpcError(code, message, data=UnsetType.UNSET)[source]#
Bases:
JsonRpcErrorServer JSON-RPC error.
- class pjrpc.server.Method(func, name=None, *, pass_context=False, validator_factory=None, metadata=())[source]#
Bases:
objectJSON-RPC method wrapper. Stores method itself and some metainformation.
- class pjrpc.server.MethodRegistry(validator_factory=None, metadata=(), metadata_processors=())[source]#
Bases:
objectMethod registry.
- Parameters:
- add(name=None, *, pass_context=False, metadata=())[source]#
Decorator adding decorated method to the registry.
- class pjrpc.server.MiddlewareType(*args, **kwargs)[source]#
Bases:
Protocol[ContextType]Synchronous middleware type
Types#
- pjrpc.server.typedefs.AsyncHandlerType#
Async RPC handler method, passed to middlewares
alias of
Callable[[Request,ContextType],Awaitable[Union[UnsetType,Response]]]
- class pjrpc.server.typedefs.AsyncMiddlewareType(*args, **kwargs)[source]#
Bases:
Protocol[ContextType]Asynchronous middleware type
- pjrpc.server.typedefs.ContextType#
Context argument for RPC methods and middlewares
alias of TypeVar(‘ContextType’)
- pjrpc.server.typedefs.HandlerType#
Blocking RPC handler method, passed to middlewares
alias of
Callable[[Request,ContextType],Union[UnsetType,Response]]
- pjrpc.server.typedefs.MiddlewareResponse#
middlewares and handlers return Response or UnsetType
- class pjrpc.server.typedefs.MiddlewareType(*args, **kwargs)[source]#
Bases:
Protocol[ContextType]Synchronous middleware type
Integrations#
aiohttp#
aiohttp JSON-RPC server integration.
- class pjrpc.server.integration.aiohttp.Application(prefix='', http_app=None, status_by_error=<function Application.<lambda>>, executor=None, json_loader=<function loads>, json_dumper=<function dumps>, json_encoder=<class 'pjrpc.server.dispatcher.JSONEncoder'>, json_decoder=None, middlewares=(), max_batch_size=None)[source]#
Bases:
objectaiohttp based JSON-RPC server.
- Parameters:
prefix (str) – JSON-RPC handler base path
http_app (Optional[Application]) – aiohttp application instance
status_by_error (Callable[[tuple[int, ...]], int]) – a function returns http status code by json-rpc error codes, 200 for all errors by default
executor (Optional[AsyncExecutor]) –
json_encoder (type[pjrpc.server.dispatcher.JSONEncoder]) –
middlewares (Iterable[AsyncMiddlewareType[Request]]) –
- property http_app: Application#
aiohttp application.
- property endpoints: Mapping[str, AsyncDispatcher[Request]]#
JSON-RPC application registered endpoints.
- add_methods(registry, endpoint='')[source]#
Adds methods to the provided endpoint.
- Parameters:
registry (MethodRegistry) – methods registry
endpoint (str) – endpoint path
- Return type:
- add_subapp(prefix, subapp)[source]#
Adds sub-application accessible under provided prefix.
- Parameters:
prefix (str) – path under which sub-application is accessed.
subapp (Application) – sub-application instance
- Return type:
None
- add_spec(spec, endpoint='', path='')[source]#
Adds JSON-RPC specification of the provided endpoint to the provided path.
- Parameters:
spec (Specification) – JSON-RPC specification
endpoint (str) – specification endpoint
path (str) – path under witch the specification will be accessible.
- Return type:
None
flask#
aio_pika#
werkzeug#
Validators#
JSON-RPC method parameters validators.
- class pjrpc.server.validators.BaseValidator(method, exclude=None)[source]#
Bases:
objectBase method parameters validator.
- Parameters:
- class pjrpc.server.validators.BaseValidatorFactory(exclude=None)[source]#
Bases:
objectBase method parameters validator factory. Uses
inspect.signature()for validation.
- exception pjrpc.server.validators.ValidationError[source]#
Bases:
ExceptionMethod parameters validation error. Raised when parameters validation failed.
pydantic#
Specification#
- class pjrpc.server.specs.JSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]#
Bases:
JSONEncoderSchema JSON encoder.
- default(o)[source]#
Implement this method in a subclass such that it returns a serializable object for
o, or calls the base implementation (to raise aTypeError).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return super().default(o)
- class pjrpc.server.specs.Specification[source]#
Bases:
ABCJSON-RPC specification.
extractors#
- class pjrpc.server.specs.extractors.BaseMethodInfoExtractor[source]#
Bases:
objectBase method schema extractor.
- extract_response_schema(method_name, method, ref_template, errors=None)[source]#
Extracts response schema.
- extract_error_response_schema(method_name, method, ref_template, errors=None)[source]#
Extracts error response schema.
schemas#
openapi#
OpenAPI Specification generator. See https://swagger.io/specification/.
- class pjrpc.server.specs.openapi.ApiKeyLocation(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
The location of the API key.
- class pjrpc.server.specs.openapi.Components(schemas=UnsetType.UNSET, responses=UnsetType.UNSET, parameters=UnsetType.UNSET, examples=UnsetType.UNSET, requestBodies=UnsetType.UNSET, headers=UnsetType.UNSET, securitySchemes=UnsetType.UNSET, links=UnsetType.UNSET, pathItems=UnsetType.UNSET)[source]#
Bases:
objectHolds a set of reusable objects for different aspects of the OAS.
- Parameters:
securitySchemes (Union[UnsetType, dict[str, Union[pjrpc.server.specs.openapi.spec.SecurityScheme, pjrpc.server.specs.openapi.spec.Reference]]]) – an object to hold reusable Security Scheme Objects
schemas (Union[UnsetType, dict[str, dict[str, Union[str, int, float, dict[str, Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], bool, list[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], tuple[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], set[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], NoneType]]]]) – the definition of input and output data types
responses (Union[UnsetType, dict[str, Union[pjrpc.server.specs.openapi.spec.Response, pjrpc.server.specs.openapi.spec.Reference]]]) –
parameters (Union[UnsetType, dict[str, Union[pjrpc.server.specs.openapi.spec.Parameter, pjrpc.server.specs.openapi.spec.Reference]]]) –
examples (Union[UnsetType, dict[str, Union[pjrpc.server.specs.openapi.spec.ExampleObject, pjrpc.server.specs.openapi.spec.Reference]]]) –
requestBodies (Union[UnsetType, dict[str, Union[pjrpc.server.specs.openapi.spec.RequestBody, pjrpc.server.specs.openapi.spec.Reference]]]) –
headers (Union[UnsetType, dict[str, Union[pjrpc.server.specs.openapi.spec.Parameter, pjrpc.server.specs.openapi.spec.Reference]]]) –
links (Union[UnsetType, dict[str, dict[str, Union[pjrpc.server.specs.openapi.spec.Link, pjrpc.server.specs.openapi.spec.Reference]]]]) –
pathItems (Union[UnsetType, dict[str, Union[pjrpc.server.specs.openapi.spec.Path, pjrpc.server.specs.openapi.spec.Reference]]]) –
- class pjrpc.server.specs.openapi.Contact(name=UnsetType.UNSET, url=UnsetType.UNSET, email=UnsetType.UNSET)[source]#
Bases:
objectContact information for the exposed API.
- class pjrpc.server.specs.openapi.Encoding(contentType=UnsetType.UNSET, headers=UnsetType.UNSET, style=UnsetType.UNSET, explode=UnsetType.UNSET, allowReserved=UnsetType.UNSET)[source]#
Bases:
objectA single encoding definition applied to a single schema property.
- Parameters:
contentType (Union[UnsetType, str]) – the Content-Type for encoding a specific property
headers (Union[UnsetType, dict[str, Union[pjrpc.server.specs.openapi.spec.Parameter, pjrpc.server.specs.openapi.spec.Reference]]]) – a map allowing additional information to be provided as headers
style (Union[UnsetType, str]) – describes how a specific property value will be serialized depending on its type
explode (Union[UnsetType, bool]) – when this is true, property values of type array or object generate separate parameters for each value of the array, or key-value-pair of the map
allowReserved (Union[UnsetType, bool]) – determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986 to be included without percent-encoding
- class pjrpc.server.specs.openapi.ExampleObject(value=UnsetType.UNSET, summary=UnsetType.UNSET, description=UnsetType.UNSET, externalValue=UnsetType.UNSET)[source]#
Bases:
objectMethod usage example.
- class pjrpc.server.specs.openapi.ExternalDocumentation(url, description=UnsetType.UNSET)[source]#
Bases:
objectAllows referencing an external resource for extended documentation.
- class pjrpc.server.specs.openapi.Info(title, version, summary=UnsetType.UNSET, description=UnsetType.UNSET, contact=UnsetType.UNSET, license=UnsetType.UNSET, termsOfService=UnsetType.UNSET)[source]#
Bases:
objectMetadata about the API.
- Parameters:
title (str) – the title of the application
version (str) – the version of the OpenAPI document
summary (Union[UnsetType, str]) – a short summary of the API.
description (Union[UnsetType, str]) – a description of the application
contact (Union[UnsetType, Contact]) – the contact information for the exposed API
license (Union[UnsetType, License]) – the license information for the exposed API
termsOfService (Union[UnsetType, str]) – a URL to the Terms of Service for the API
- class pjrpc.server.specs.openapi.License(name, identifier=UnsetType.UNSET, url=UnsetType.UNSET)[source]#
Bases:
objectLicense information for the exposed API.
- class pjrpc.server.specs.openapi.Link(operationRef=UnsetType.UNSET, operationId=UnsetType.UNSET, parameters=UnsetType.UNSET, requestBody=UnsetType.UNSET, description=UnsetType.UNSET, server=UnsetType.UNSET)[source]#
Bases:
objectThe Link object represents a possible design-time link for a response.
- Parameters:
operationRef (Union[UnsetType, str]) – a relative or absolute URI reference to an OAS operation
operationId (Union[UnsetType, str]) – the name of an existing, resolvable OAS operation, as defined with a unique operationId
parameters (Union[UnsetType, dict[str, Any]]) – a map representing parameters to pass to an operation as specified with operationId or identified via operationRef
requestBody (Union[UnsetType, Any]) – a literal value or {expression} to use as a request body when calling the target operation
description (Union[UnsetType, str]) – a description of the link
server (Union[UnsetType, Server]) – a server object to be used by the target operation.
- class pjrpc.server.specs.openapi.MediaType(schema=UnsetType.UNSET, example=UnsetType.UNSET, examples=UnsetType.UNSET, encoding=UnsetType.UNSET)[source]#
Bases:
objectEach Media Type Object provides schema and examples for the media type identified by its key.
- pjrpc.server.specs.openapi.metadata(params_schema=UnsetType.UNSET, result_schema=UnsetType.UNSET, errors=UnsetType.UNSET, examples=UnsetType.UNSET, tags=UnsetType.UNSET, summary=UnsetType.UNSET, description=UnsetType.UNSET, external_docs=UnsetType.UNSET, deprecated=UnsetType.UNSET, security=UnsetType.UNSET, parameters=UnsetType.UNSET, servers=UnsetType.UNSET, component_name_prefix=UnsetType.UNSET)[source]#
Adds Open Api specification annotation to the method.
- Parameters:
params_schema (Union[UnsetType, dict[str, dict[str, Union[str, int, float, dict[str, Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], bool, list[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], tuple[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], set[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], NoneType]]]]) – method parameters JSON schema
result_schema (Union[UnsetType, dict[str, Union[str, int, float, dict[str, Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], bool, list[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], tuple[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], set[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], NoneType]]]) – method result JSON schema
errors (Union[UnsetType, list[type[pjrpc.server.exceptions.TypedError]]]) – method errors
examples (Union[UnsetType, list[pjrpc.server.specs.openapi.spec.MethodExample]]) – method usage examples
tags (Union[UnsetType, list[Union[str, pjrpc.server.specs.openapi.spec.Tag]]]) – a list of tags for method documentation control
summary (Union[UnsetType, str]) – a short summary of what the method does
description (Union[UnsetType, str]) – a verbose explanation of the method behavior
external_docs (Union[UnsetType, ExternalDocumentation]) – an external resource for extended documentation
deprecated (Union[UnsetType, bool]) – declares this method to be deprecated
security (Union[UnsetType, list[dict[str, list[str]]]]) – a declaration of which security mechanisms can be used for the method
parameters (Union[UnsetType, list[pjrpc.server.specs.openapi.spec.Parameter]]) – a list of parameters that are applicable for the method
servers (Union[UnsetType, list[pjrpc.server.specs.openapi.spec.Server]]) – a list of connectivity information of a target server.
component_name_prefix (Union[UnsetType, str]) – components name prefix.
- Return type:
- class pjrpc.server.specs.openapi.MethodExample(params, result, version='2.0', summary=UnsetType.UNSET, description=UnsetType.UNSET)[source]#
Bases:
objectMethod usage example.
- class pjrpc.server.specs.openapi.MethodMetadata(params_schema: Union[pjrpc.common.common.UnsetType, dict[str, dict[str, Union[str, int, float, dict[str, 'Json'], bool, list['Json'], tuple['Json'], set['Json'], NoneType]]]] = UNSET, result_schema: Union[pjrpc.common.common.UnsetType, dict[str, Union[str, int, float, dict[str, 'Json'], bool, list['Json'], tuple['Json'], set['Json'], NoneType]]] = UNSET, examples: Union[pjrpc.common.common.UnsetType, list[pjrpc.server.specs.openapi.spec.MethodExample]] = UNSET, tags: Union[pjrpc.common.common.UnsetType, list[pjrpc.server.specs.openapi.spec.Tag]] = UNSET, summary: Union[pjrpc.common.common.UnsetType, str] = UNSET, description: Union[pjrpc.common.common.UnsetType, str] = UNSET, external_docs: Union[pjrpc.common.common.UnsetType, pjrpc.server.specs.openapi.spec.ExternalDocumentation] = UNSET, deprecated: Union[pjrpc.common.common.UnsetType, bool] = UNSET, security: Union[pjrpc.common.common.UnsetType, list[dict[str, list[str]]]] = UNSET, parameters: Union[pjrpc.common.common.UnsetType, list[pjrpc.server.specs.openapi.spec.Parameter]] = UNSET, servers: Union[pjrpc.common.common.UnsetType, list[pjrpc.server.specs.openapi.spec.Server]] = UNSET, component_name_prefix: Union[pjrpc.common.common.UnsetType, str] = UNSET, errors: Union[pjrpc.common.common.UnsetType, list[type[pjrpc.server.exceptions.TypedError]]] = UNSET)[source]#
Bases:
object- Parameters:
params_schema (Union[UnsetType, dict[str, dict[str, Union[str, int, float, dict[str, Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], bool, list[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], tuple[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], set[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], NoneType]]]]) –
result_schema (Union[UnsetType, dict[str, Union[str, int, float, dict[str, Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], bool, list[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], tuple[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], set[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], NoneType]]]) –
examples (Union[UnsetType, list[pjrpc.server.specs.openapi.spec.MethodExample]]) –
tags (Union[UnsetType, list[pjrpc.server.specs.openapi.spec.Tag]]) –
external_docs (Union[UnsetType, ExternalDocumentation]) –
parameters (Union[UnsetType, list[pjrpc.server.specs.openapi.spec.Parameter]]) –
servers (Union[UnsetType, list[pjrpc.server.specs.openapi.spec.Server]]) –
errors (Union[UnsetType, list[type[pjrpc.server.exceptions.TypedError]]]) –
- class pjrpc.server.specs.openapi.OAuthFlow(authorizationUrl, tokenUrl, scopes, refreshUrl=UnsetType.UNSET)[source]#
Bases:
objectConfiguration details for a supported OAuth Flow.
- Parameters:
- class pjrpc.server.specs.openapi.OAuthFlows(implicit=UnsetType.UNSET, password=UnsetType.UNSET, clientCredentials=UnsetType.UNSET, authorizationCode=UnsetType.UNSET)[source]#
Bases:
objectConfiguration of the supported OAuth Flows.
- Parameters:
implicit (Union[UnsetType, OAuthFlow]) – configuration for the OAuth Implicit flow
password (Union[UnsetType, OAuthFlow]) – configuration for the OAuth Resource Owner Password flow
clientCredentials (Union[UnsetType, OAuthFlow]) – configuration for the OAuth Client Credentials flow
authorizationCode (Union[UnsetType, OAuthFlow]) – configuration for the OAuth Authorization Code flow
- class pjrpc.server.specs.openapi.OpenAPI(info, servers=UnsetType.UNSET, external_docs=UnsetType.UNSET, tags=UnsetType.UNSET, security=UnsetType.UNSET, security_schemes=UnsetType.UNSET, openapi='3.1.0', json_schema_dialect=UnsetType.UNSET)[source]#
Bases:
SpecificationOpenAPI Specification.
- Parameters:
info (Info) – provides metadata about the API
servers (Union[UnsetType, list[pjrpc.server.specs.openapi.spec.Server]]) – an array of Server Objects, which provide connectivity information to a target server
external_docs (Union[UnsetType, ExternalDocumentation]) – additional external documentation
openapi (str) – the semantic version number of the OpenAPI Specification version that the OpenAPI document uses
json_schema_dialect (Union[UnsetType, str]) – the default value for the $schema keyword within Schema Objects
tags (Union[UnsetType, list[pjrpc.server.specs.openapi.spec.Tag]]) – a list of tags used by the specification with additional metadata
security (Union[UnsetType, list[dict[str, list[str]]]]) – a declaration of which security mechanisms can be used across the API
security_schemes (Union[UnsetType, dict[str, Union[pjrpc.server.specs.openapi.spec.SecurityScheme, pjrpc.server.specs.openapi.spec.Reference]]]) – an object to hold reusable Security Scheme Objects
- class pjrpc.server.specs.openapi.Operation(responses=UnsetType.UNSET, requestBody=UnsetType.UNSET, tags=UnsetType.UNSET, summary=UnsetType.UNSET, description=UnsetType.UNSET, externalDocs=UnsetType.UNSET, operationId=UnsetType.UNSET, deprecated=UnsetType.UNSET, servers=UnsetType.UNSET, security=UnsetType.UNSET, parameters=UnsetType.UNSET)[source]#
Bases:
objectDescribes a single API operation on a path.
- Parameters:
tags (Union[UnsetType, list[str]]) – a list of tags for API documentation control
summary (Union[UnsetType, str]) – a short summary of what the operation does
description (Union[UnsetType, str]) – a verbose explanation of the operation behavior
externalDocs (Union[UnsetType, ExternalDocumentation]) – additional external documentation for this operation
requestBody (Union[UnsetType, RequestBody, Reference]) – the request body applicable for this operation
responses (Union[UnsetType, dict[str, Union[pjrpc.server.specs.openapi.spec.Response, pjrpc.server.specs.openapi.spec.Reference]]]) – the list of possible responses as they are returned from executing this operation
deprecated (Union[UnsetType, bool]) – declares this operation to be deprecated
servers (Union[UnsetType, list[pjrpc.server.specs.openapi.spec.Server]]) – an alternative server array to service this operation
security (Union[UnsetType, list[dict[str, list[str]]]]) – a declaration of which security mechanisms can be used for this operation
parameters (Union[UnsetType, list[Union[pjrpc.server.specs.openapi.spec.Parameter, pjrpc.server.specs.openapi.spec.Reference]]]) –
- class pjrpc.server.specs.openapi.Parameter(name, location, description=UnsetType.UNSET, required=UnsetType.UNSET, deprecated=UnsetType.UNSET, allowEmptyValue=UnsetType.UNSET, style=UnsetType.UNSET, explode=UnsetType.UNSET, allowReserved=UnsetType.UNSET, schema=UnsetType.UNSET, example=UnsetType.UNSET, examples=UnsetType.UNSET, content=UnsetType.UNSET)[source]#
Bases:
objectDescribes a single operation parameter.
- Parameters:
name (str) – the name of the parameter
location (ParameterLocation) – the location of the parameter
description (Union[UnsetType, str]) – a brief description of the parameter
required (Union[UnsetType, bool]) – determines whether this parameter is mandatory
deprecated (Union[UnsetType, bool]) – a parameter is deprecated and SHOULD be transitioned out of usage
allowEmptyValue (Union[UnsetType, bool]) – the ability to pass empty-valued parameters
style (Union[UnsetType, StyleType]) – describes how the parameter value will be serialized depending on the type of the parameter value
explode (Union[UnsetType, bool]) – when this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map
allowReserved (Union[UnsetType, bool]) – determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986 :/?#[]@!$&’()*+,;= to be included without percent-encoding
schema (Union[UnsetType, dict[str, Union[str, int, float, dict[str, Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], bool, list[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], tuple[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], set[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], NoneType]]]) – the schema defining the type used for the parameter.
examples (Union[UnsetType, dict[str, pjrpc.server.specs.openapi.spec.ExampleObject]]) – examples of the parameter’s potential value
content (Union[UnsetType, dict[str, pjrpc.server.specs.openapi.spec.MediaType]]) – a map containing the representations for the parameter
- class pjrpc.server.specs.openapi.ParameterLocation(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
The location of the parameter.
- class pjrpc.server.specs.openapi.Path(get=UnsetType.UNSET, put=UnsetType.UNSET, post=UnsetType.UNSET, delete=UnsetType.UNSET, options=UnsetType.UNSET, head=UnsetType.UNSET, patch=UnsetType.UNSET, trace=UnsetType.UNSET, summary=UnsetType.UNSET, description=UnsetType.UNSET, servers=UnsetType.UNSET, parameters=UnsetType.UNSET)[source]#
Bases:
objectDescribes the interface for the given method name.
- Parameters:
summary (Union[UnsetType, str]) – an optional, string summary, intended to apply to all operations in this path
description (Union[UnsetType, str]) – an optional, string description, intended to apply to all operations in this path
servers (Union[UnsetType, list[pjrpc.server.specs.openapi.spec.Server]]) – an alternative server array to service all operations in this path
parameters (Union[UnsetType, Parameter, Reference]) – a list of parameters that are applicable for all the operations described under this path
- class pjrpc.server.specs.openapi.Reference(ref, summary=UnsetType.UNSET, description=UnsetType.UNSET)[source]#
Bases:
objectA simple object to allow referencing other components in the OpenAPI document, internally and externally.
- class pjrpc.server.specs.openapi.RequestBody(content, required=UnsetType.UNSET, description=UnsetType.UNSET)[source]#
Bases:
objectDescribes a single request body.
- class pjrpc.server.specs.openapi.Response(description, headers=UnsetType.UNSET, content=UnsetType.UNSET, links=UnsetType.UNSET)[source]#
Bases:
objectA container for the expected responses of an operation.
- Parameters:
description (str) – a short description of the response
content (Union[UnsetType, dict[str, pjrpc.server.specs.openapi.spec.MediaType]]) – a map containing descriptions of potential response payloads
headers (Union[UnsetType, dict[str, Union[pjrpc.server.specs.openapi.spec.Parameter, pjrpc.server.specs.openapi.spec.Reference]]]) –
links (Union[UnsetType, dict[str, Union[pjrpc.server.specs.openapi.spec.Link, pjrpc.server.specs.openapi.spec.Reference]]]) –
- class pjrpc.server.specs.openapi.SecurityScheme(type, scheme=UnsetType.UNSET, name=UnsetType.UNSET, location=UnsetType.UNSET, bearerFormat=UnsetType.UNSET, flows=UnsetType.UNSET, openIdConnectUrl=UnsetType.UNSET, description=UnsetType.UNSET)[source]#
Bases:
objectDefines a security scheme that can be used by the operations.
- Parameters:
type (SecuritySchemeType) – the type of the security scheme
name (Union[UnsetType, str]) – the name of the header, query or cookie parameter to be used
location (Union[UnsetType, ApiKeyLocation]) – the location of the API key
scheme (Union[UnsetType, str]) – the name of the HTTP Authorization scheme to be used in the Authorization header
bearerFormat (Union[UnsetType, str]) – a hint to the client to identify how the bearer token is formatted
flows (Union[UnsetType, OAuthFlows]) – an object containing configuration information for the flow types supported
description (Union[UnsetType, str]) – a short description for security scheme
- class pjrpc.server.specs.openapi.SecuritySchemeType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
The type of the security scheme.
- class pjrpc.server.specs.openapi.Server(url, description=UnsetType.UNSET, variables=UnsetType.UNSET)[source]#
Bases:
objectConnectivity information of a target server.
- Parameters:
url (str) – a URL to the target host
description (Union[UnsetType, str]) – an optional string describing the host designated by the URL
variables (Union[UnsetType, dict[str, pjrpc.server.specs.openapi.spec.ServerVariable]]) – a map between a variable name and its value. The value is used for substitution in the server’s URL template.
- class pjrpc.server.specs.openapi.ServerVariable(default, enum=UnsetType.UNSET, description=UnsetType.UNSET)[source]#
Bases:
objectAn object representing a Server Variable for server URL template substitution.
- Parameters:
default (str) – the default value to use for substitution, which SHALL be sent if an alternate value is not supplied
enum (Union[UnsetType, list[str]]) – an enumeration of string values to be used if the substitution options are from a limited set
description (Union[UnsetType, str]) – an optional description for the server variable
- class pjrpc.server.specs.openapi.SpecRoot(info, paths, components, servers=UnsetType.UNSET, externalDocs=UnsetType.UNSET, tags=UnsetType.UNSET, security=UnsetType.UNSET, openapi='3.1.0', jsonSchemaDialect=UnsetType.UNSET)[source]#
Bases:
objectThe root object of the OpenAPI description.
- Parameters:
info (Info) – provides metadata about the API
servers (Union[UnsetType, list[pjrpc.server.specs.openapi.spec.Server]]) – an array of Server Objects, which provide connectivity information to a target server
externalDocs (Union[UnsetType, ExternalDocumentation]) – additional external documentation
openapi (str) – the semantic version number of the OpenAPI Specification version that the OpenAPI document uses
jsonSchemaDialect (Union[UnsetType, str]) – the default value for the $schema keyword within Schema Objects
tags (Union[UnsetType, list[pjrpc.server.specs.openapi.spec.Tag]]) – a list of tags used by the specification with additional metadata
security (Union[UnsetType, list[dict[str, list[str]]]]) – a declaration of which security mechanisms can be used across the API
paths (dict[str, pjrpc.server.specs.openapi.spec.Path]) –
components (Components) –
- class pjrpc.server.specs.openapi.StyleType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
Describes how the parameter value will be serialized depending on the type of the parameter value.
openrpc#
OpenRPC specification generator. See https://spec.open-rpc.org/.
- class pjrpc.server.specs.openrpc.Components(contentDescriptors=UnsetType.UNSET, schemas=UnsetType.UNSET, examples=UnsetType.UNSET, links=UnsetType.UNSET, errors=UnsetType.UNSET, examplePairingObjects=UnsetType.UNSET, tags=UnsetType.UNSET)[source]#
Bases:
objectSet of reusable objects for different aspects of the OpenRPC.
- Parameters:
contentDescriptors (Union[UnsetType, dict[str, pjrpc.server.specs.openrpc.spec.ContentDescriptor]]) – reusable Schema Objects
schemas (Union[UnsetType, dict[str, dict[str, Union[str, int, float, dict[str, Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], bool, list[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], tuple[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], set[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], NoneType]]]]) – reusable Schema Objects
examples (Union[UnsetType, dict[str, pjrpc.server.specs.openrpc.spec.ExampleObject]]) – reusable Schema Objects
links (Union[UnsetType, dict[str, pjrpc.server.specs.openrpc.spec.Link]]) – reusable Schema Objects
errors (Union[UnsetType, dict[str, pjrpc.server.specs.openrpc.spec.Error]]) – reusable Schema Objects
examplePairingObjects (Union[UnsetType, dict[str, pjrpc.server.specs.openrpc.spec.MethodExample]]) – reusable Schema Objects
tags (Union[UnsetType, dict[str, pjrpc.server.specs.openrpc.spec.Tag]]) – reusable Schema Objects
- class pjrpc.server.specs.openrpc.Contact(name=UnsetType.UNSET, url=UnsetType.UNSET, email=UnsetType.UNSET)[source]#
Bases:
objectContact information for the exposed API.
- class pjrpc.server.specs.openrpc.ContentDescriptor(name, schema, summary=UnsetType.UNSET, description=UnsetType.UNSET, required=UnsetType.UNSET, deprecated=UnsetType.UNSET)[source]#
Bases:
objectContent Descriptors are objects that describe content. They are reusable ways of describing either parameters or result.
- Parameters:
name (str) – name of the content that is being described
schema (dict[str, Union[str, int, float, dict[str, Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], bool, list[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], tuple[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], set[Union[str, int, float, dict[str, ForwardRef('Json')], bool, list[ForwardRef('Json')], tuple[ForwardRef('Json')], set[ForwardRef('Json')], NoneType]], NoneType]]) – schema that describes the content. The Schema Objects MUST follow the specifications outline in the JSON Schema Specification 7 (https://json-schema.org/draft-07/json-schema-release-notes.html)
summary (Union[UnsetType, str]) – a short summary of the content that is being described
description (Union[UnsetType, str]) – a verbose explanation of the content descriptor behavior
required (Union[UnsetType, bool]) – determines if the content is a required field
deprecated (Union[UnsetType, bool]) – specifies that the content is deprecated and SHOULD be transitioned out of usage
- class pjrpc.server.specs.openrpc.Error(code, message, data=UnsetType.UNSET)[source]#
Bases:
objectDefines an application level error.
- class pjrpc.server.specs.openrpc.ExampleObject(value, name, summary=UnsetType.UNSET, description=UnsetType.UNSET, externalValue=UnsetType.UNSET)[source]#
Bases:
objectThe ExampleObject object is an object the defines an example.
- Parameters:
value (Any) – embedded literal example
name (str) – canonical name of the example
summary (Union[UnsetType, str]) – short description for the example
description (Union[UnsetType, str]) – a verbose explanation of the example
externalValue (Union[UnsetType, str]) – a URL that points to the literal example.
- class pjrpc.server.specs.openrpc.ExternalDocumentation(url, description=UnsetType.UNSET)[source]#
Bases:
objectAllows referencing an external resource for extended documentation.
- class pjrpc.server.specs.openrpc.Info(title, version, description=UnsetType.UNSET, contact=UnsetType.UNSET, license=UnsetType.UNSET, termsOfService=UnsetType.UNSET)[source]#
Bases:
objectMetadata about the API.
- Parameters:
title (str) – the title of the application
version (str) – the version of the OpenRPC document
description (Union[UnsetType, str]) – a verbose description of the application
contact (Union[UnsetType, Contact]) – the contact information for the exposed API
license (Union[UnsetType, License]) – the license information for the exposed API
termsOfService (Union[UnsetType, str]) – a URL to the Terms of Service for the API
- class pjrpc.server.specs.openrpc.License(name, url=UnsetType.UNSET)[source]#
Bases:
objectLicense information for the exposed API.
- class pjrpc.server.specs.openrpc.Link(name, description=UnsetType.UNSET, summary=UnsetType.UNSET, method=UnsetType.UNSET, params=UnsetType.UNSET, server=UnsetType.UNSET)[source]#
Bases:
object- Parameters:
name (str) – Canonical name of the link.
description (Union[UnsetType, str]) – A description of the link.
summary (Union[UnsetType, str]) – Short description for the link.
method (Union[UnsetType, str]) – The name of an existing, resolvable OpenRPC method, as defined with a unique method.
params (Union[UnsetType, dict[str, Any]]) – A map representing parameters to pass to a method as specified with method. The key is the parameter name to be used, whereas the value can be a constant or a runtime expression to be evaluated and passed to the linked method.
server (Union[UnsetType, Server]) – A server object to be used by the target method.
- pjrpc.server.specs.openrpc.metadata(params_schema=UnsetType.UNSET, result_schema=UnsetType.UNSET, errors=UnsetType.UNSET, examples=UnsetType.UNSET, summary=UnsetType.UNSET, description=UnsetType.UNSET, tags=UnsetType.UNSET, deprecated=UnsetType.UNSET, external_docs=UnsetType.UNSET, servers=UnsetType.UNSET)[source]#
Adds JSON-RPC method to the API specification.
- Parameters:
params_schema (Union[UnsetType, list[pjrpc.server.specs.openrpc.spec.ContentDescriptor]]) – a list of parameters that are applicable for this method
result_schema (Union[UnsetType, ContentDescriptor]) – the description of the result returned by the method
errors (Union[UnsetType, list[Union[pjrpc.server.specs.openrpc.spec.Error, type[pjrpc.server.exceptions.TypedError]]]]) – a list of custom application defined errors that MAY be returned
examples (Union[UnsetType, list[Union[pjrpc.server.specs.openrpc.spec.MethodExample, pjrpc.server.specs.openrpc.spec.Reference]]]) – method usage example
summary (Union[UnsetType, str]) – a short summary of what the method does
description (Union[UnsetType, str]) – a verbose explanation of the method behavior
tags (Union[UnsetType, list[Union[pjrpc.server.specs.openrpc.spec.Tag, str]]]) – a list of tags for API documentation control
deprecated (Union[UnsetType, bool]) – declares this method to be deprecated
external_docs (Union[UnsetType, ExternalDocumentation]) – additional external documentation for the method
servers (Union[UnsetType, list[pjrpc.server.specs.openrpc.spec.Server]]) – an alternative servers array to service this method
- Return type:
- class pjrpc.server.specs.openrpc.MethodExample(name, params, result, summary=UnsetType.UNSET, description=UnsetType.UNSET)[source]#
Bases:
objectThe example Pairing object consists of a set of example params and result.
- Parameters:
params (list[Union[pjrpc.server.specs.openrpc.spec.ExampleObject, pjrpc.server.specs.openrpc.spec.Reference]]) – example parameters
result (Union[ExampleObject, Reference]) – example result
name (str) – name for the example pairing
summary (Union[UnsetType, str]) – short description for the example pairing
description (Union[UnsetType, str]) – a verbose explanation of the example pairing
- class pjrpc.server.specs.openrpc.MethodInfo(name, params, result, errors=UnsetType.UNSET, links=UnsetType.UNSET, paramStructure=UnsetType.UNSET, examples=UnsetType.UNSET, summary=UnsetType.UNSET, description=UnsetType.UNSET, tags=UnsetType.UNSET, deprecated=UnsetType.UNSET, externalDocs=UnsetType.UNSET, servers=UnsetType.UNSET)[source]#
Bases:
objectDescribes the interface for the given method name.
- Parameters:
name (str) – the canonical name for the method
params (list[Union[pjrpc.server.specs.openrpc.spec.ContentDescriptor, pjrpc.server.specs.openrpc.spec.Reference]]) – a list of parameters that are applicable for this method
result (Union[ContentDescriptor, Reference]) – the description of the result returned by the method
errors (Union[UnsetType, list[Union[pjrpc.server.specs.openrpc.spec.Error, pjrpc.server.specs.openrpc.spec.Reference]]]) – a list of custom application defined errors that MAY be returned
examples (Union[UnsetType, list[Union[pjrpc.server.specs.openrpc.spec.MethodExample, pjrpc.server.specs.openrpc.spec.Reference]]]) – method usage examples
summary (Union[UnsetType, str]) – a short summary of what the method does
description (Union[UnsetType, str]) – a verbose explanation of the method behavior
tags (Union[UnsetType, list[Union[pjrpc.server.specs.openrpc.spec.Tag, pjrpc.server.specs.openrpc.spec.Reference]]]) – a list of tags for API documentation control
deprecated (Union[UnsetType, bool]) – declares this method to be deprecated
paramStructure (Union[UnsetType, ParamStructure]) – the expected format of the parameters
externalDocs (Union[UnsetType, ExternalDocumentation]) – additional external documentation for this method
servers (Union[UnsetType, list[pjrpc.server.specs.openrpc.spec.Server]]) – an alternative servers array to service this method
links (Union[UnsetType, list[Union[pjrpc.server.specs.openrpc.spec.Link, pjrpc.server.specs.openrpc.spec.Reference]]]) –
- class pjrpc.server.specs.openrpc.MethodMetadata(params_schema: Union[pjrpc.common.common.UnsetType, list[pjrpc.server.specs.openrpc.spec.ContentDescriptor]] = UNSET, result_schema: Union[pjrpc.common.common.UnsetType, pjrpc.server.specs.openrpc.spec.ContentDescriptor] = UNSET, errors: Union[pjrpc.common.common.UnsetType, list[pjrpc.server.specs.openrpc.spec.Error]] = UNSET, examples: Union[pjrpc.common.common.UnsetType, list[Union[pjrpc.server.specs.openrpc.spec.MethodExample, pjrpc.server.specs.openrpc.spec.Reference]]] = UNSET, tags: Union[pjrpc.common.common.UnsetType, list[Union[pjrpc.server.specs.openrpc.spec.Tag, pjrpc.server.specs.openrpc.spec.Reference]]] = UNSET, summary: Union[pjrpc.common.common.UnsetType, str] = UNSET, description: Union[pjrpc.common.common.UnsetType, str] = UNSET, deprecated: Union[pjrpc.common.common.UnsetType, bool] = UNSET, external_docs: Union[pjrpc.common.common.UnsetType, pjrpc.server.specs.openrpc.spec.ExternalDocumentation] = UNSET, servers: Union[pjrpc.common.common.UnsetType, list[pjrpc.server.specs.openrpc.spec.Server]] = UNSET)[source]#
Bases:
object- Parameters:
params_schema (Union[UnsetType, list[pjrpc.server.specs.openrpc.spec.ContentDescriptor]]) –
result_schema (Union[UnsetType, ContentDescriptor]) –
errors (Union[UnsetType, list[pjrpc.server.specs.openrpc.spec.Error]]) –
examples (Union[UnsetType, list[Union[pjrpc.server.specs.openrpc.spec.MethodExample, pjrpc.server.specs.openrpc.spec.Reference]]]) –
tags (Union[UnsetType, list[Union[pjrpc.server.specs.openrpc.spec.Tag, pjrpc.server.specs.openrpc.spec.Reference]]]) –
external_docs (Union[UnsetType, ExternalDocumentation]) –
servers (Union[UnsetType, list[pjrpc.server.specs.openrpc.spec.Server]]) –
- class pjrpc.server.specs.openrpc.OpenRPC(info, servers=UnsetType.UNSET, external_docs=UnsetType.UNSET, openrpc='1.3.2')[source]#
Bases:
SpecificationOpenRPC Specification.
- Parameters:
info (Info) – provides metadata about the API
servers (Union[UnsetType, list[pjrpc.server.specs.openrpc.spec.Server]]) – connectivity information
external_docs (Union[UnsetType, ExternalDocumentation]) – additional external documentation
openrpc (str) – the semantic version number of the OpenRPC Specification version that the OpenRPC document uses
- class pjrpc.server.specs.openrpc.ParamStructure(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
The expected format of the parameters.
- class pjrpc.server.specs.openrpc.Reference(ref)[source]#
Bases:
objectA simple object to allow referencing other components in the specification, internally and externally. :param ref: the reference identifier.
- Parameters:
ref (str) –
- class pjrpc.server.specs.openrpc.Server(name, url, summary=UnsetType.UNSET, description=UnsetType.UNSET, variables=UnsetType.UNSET)[source]#
Bases:
objectConnectivity information of a target server.
- Parameters:
name (str) – a name to be used as the canonical name for the server.
url (str) – a URL to the target host. This URL supports Server Variables.
summary (Union[UnsetType, str]) – a short summary of what the server is
description (Union[UnsetType, str]) – an optional string describing the host designated by the URL
variables (Union[UnsetType, dict[str, pjrpc.server.specs.openrpc.spec.ServerVariable]]) – A map between a variable name and its value. The value is passed into the Runtime Expression to produce a server URL.
- class pjrpc.server.specs.openrpc.ServerVariable(default, enum=UnsetType.UNSET, description=UnsetType.UNSET)[source]#
Bases:
objectAn object representing a Server Variable for server URL template substitution.
- class pjrpc.server.specs.openrpc.SpecRoot(info, components, methods=<factory>, servers=UnsetType.UNSET, externalDocs=UnsetType.UNSET, openrpc='1.3.2')[source]#
Bases:
objectThe root object of the OpenRPC document.
- Parameters:
info (Info) – provides metadata about the API
components (Components) – an element to hold various schemas for the specification.
methods (list[Union[pjrpc.server.specs.openrpc.spec.MethodInfo, pjrpc.server.specs.openrpc.spec.Reference]]) – the available methods for the API
servers (Union[UnsetType, list[pjrpc.server.specs.openrpc.spec.Server]]) – connectivity information
externalDocs (Union[UnsetType, ExternalDocumentation]) – additional external documentation
openrpc (str) – the semantic version number of the OpenRPC Specification version that the OpenRPC document uses