Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oaspub/openapi
OpenAPI types, schemas, and validators - powered by TypeBox
https://github.com/oaspub/openapi
Last synced: 3 months ago
JSON representation
OpenAPI types, schemas, and validators - powered by TypeBox
- Host: GitHub
- URL: https://github.com/oaspub/openapi
- Owner: oaspub
- Created: 2023-01-21T23:49:00.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-21T18:02:20.000Z (over 1 year ago)
- Last Synced: 2024-06-16T13:14:36.088Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 32.2 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Security: SECURITY.md
Awesome Lists containing this project
README
![GitHub package.json version](https://img.shields.io/github/package-json/v/oaspub/openapi)
# OpenAPI Types, JSON Schemas, and Validators
Powered by [TypeBox](https://github.com/sinclairzx81/typebox).
## Usage
The types, schemas, and validators are broken into parts to support more fine-tuned use cases.
In most cases, the Document module is sufficient:```typescript
import { isDocument } from '@oaspub/openapi'
// import { isDocument } from '@oaspub/openapi/dist/document'let document = { ... }
if (isDocument.Check(document)) {
// do stuff
}
```If all you need to validate an operation object:
```typescript
import { isOperation } from '@oaspub/openapi'
// import { isOperation } from '@oaspub/openapi/dist/operation'let operation = { ... }
if (isOperation.Check(operation)) {
// do stuff
}
```