Skip to content

@saflib/openapi


Function: castJson()

castJson(json): DocumentV3

Takes 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.

Parameters

ParameterType
jsonany

Returns

DocumentV3