https://github.com/oaspub/openapi
OpenAPI types, schemas, and validators - powered by TypeBox
https://github.com/oaspub/openapi
Last synced: 7 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-21T18:02:20.000Z (about 2 years ago)
- Last Synced: 2024-08-17T08:06:25.186Z (11 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

# 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
}
```