https://github.com/omermecitoglu/openapi-types
TypeScript types for the OpenAPI Specification
https://github.com/omermecitoglu/openapi-types
openapi openapi-json specification swagger swagger-json ts types typescript
Last synced: 12 days ago
JSON representation
TypeScript types for the OpenAPI Specification
- Host: GitHub
- URL: https://github.com/omermecitoglu/openapi-types
- Owner: omermecitoglu
- License: mit
- Created: 2024-06-04T05:25:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-12T13:36:09.000Z (about 1 year ago)
- Last Synced: 2025-03-10T14:55:27.143Z (11 months ago)
- Topics: openapi, openapi-json, specification, swagger, swagger-json, ts, types, typescript
- Language: TypeScript
- Homepage:
- Size: 241 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenAPI 3.1 Types
[](https://www.npmjs.com/package/@omer-x/openapi-types)
[](https://www.npmjs.com/package/@omer-x/openapi-types)
[](https://codecov.io/gh/omermecitoglu/openapi-types)
[](https://opensource.org/licenses/MIT)
[](https://github.com/omermecitoglu/openapi-types/commits/main/)
[](https://github.com/omermecitoglu/openapi-types/issues)
[](https://github.com/omermecitoglu/openapi-types)
TypeScript types for the OpenAPI Specification.
## Installation
You can install this package via npm:
```bash
npm install -D @omer-x/openapi-types
```
or via yarn:
```bash
yarn add -D @omer-x/openapi-types
```
## Usage
Import the types you need in your TypeScript project:
```typescript
import { OpenApiDocument } from '@omer-x/openapi-types';
// Example usage
const openApiSpec: OpenApiDocument = {
openapi: "3.1.0",
info: {
title: "Sample API",
version: "1.0.0"
},
paths: {}
};
```
You can also import specific types directly:
```typescript
import type { ComponentsObject } from "@omer-x/openapi-types/components";
import type { ExampleObject } from "@omer-x/openapi-types/example";
import type { InfoObject } from "@omer-x/openapi-types/info";
import type { LinkObject } from "@omer-x/openapi-types/link";
import type { MediaTypeObject } from "@omer-x/openapi-types/media-type";
import type { OperationObject } from "@omer-x/openapi-types/operation";
import type { ParameterObject } from "@omer-x/openapi-types/parameter";
import type { PathItemObject, PathsObject } from "@omer-x/openapi-types/paths";
import type { ReferenceObject } from "@omer-x/openapi-types/reference";
import type { RequestBodyObject } from "@omer-x/openapi-types/request-body";
import type { ResponseObject, ResponsesObject } from "@omer-x/openapi-types/response";
import type { SchemaObject } from "@omer-x/openapi-types/schema";
import type { TagObject } from "@omer-x/openapi-types/tag";
```
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.