TypeScript types for OpenAPI 3.1
npm install ya-open-api-types[//]: # ( )
[//]: # (This file is automatically generated by a metapak)
[//]: # (module. Do not change it except between the)
[//]: # (content:start/end flags, your changes would)
[//]: # (be overridden.)
[//]: # ( )

[//]: # (::contents:start)
OpenAPI 3.1 types for TypeScript with a focus on making it customizable and to
reuse some types definitions parts (all sub types defined are exported).
The JSON schema definition is parametrized so that you can use your own
definitions and extensions :
``ts
import { type JsonValue } from 'type-fest';
import { type ExpressiveJSONSchema } from 'ya-json-schema-types';
import { type OpenAPI } from './index.js';
const myOpenAPI: OpenAPI<
ExpressiveJSONSchema,
{
'x-my-extension': ('plop' | 'plip')[];
}
> = {
openapi: '3.1',
info: {
'x-my-extension': 'plop',
title: 'Test',
version: '0.0.0',
},
paths: {},
};
``
The package also provides a few helpers to deal with OpenAPI/JSONSchemas
references (only local file anchored references are supported).
[//]: # (::contents:end)