ya-open-api-types
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

ya-open-api-types

TypeScript types for OpenAPI 3.1

GitHub license

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 :

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

Authors

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i ya-open-api-types

Weekly Downloads

604

Version

1.2.0

License

MIT

Unpacked Size

80.2 kB

Total Files

12

Last publish

Collaborators

  • nfroidure