Skip to content

@saflib/openapi


@saflib/openapi

Type Aliases

Type AliasDescription
ExtractRequestBodyConvenience type to lookup the request body by operationId.
ExtractRequestPathParamsConvenience type to lookup the path params by operationId.
ExtractRequestQueryParamsConvenience type to lookup the query params by operationId.
ExtractResponseBodyConvenience type to lookup the response body by operationId.

Variables

VariableDescription
errorSchemaThe raw error.yaml file contents from this package. There's not a great way to share OpenAPI schemas between packages, so this is exported for use elsewhere. Mainly this is used by npm exec saf-specs generate which writes the contents to schemas/error.yaml of whatever package it's run in.

Functions

FunctionDescription
castJsonTakes an imported JSON object and casts it to the OpenAPIV3.DocumentV3 type so that express-openapi-validator can validate the JSON against the OpenAPI spec without complaining about a type mismatch.