Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fosfad/json-schema-typescript-definitions
Types and interfaces for writing valid JSON schema in TypeScript.
https://github.com/fosfad/json-schema-typescript-definitions
json-schema typescript-types
Last synced: about 9 hours ago
JSON representation
Types and interfaces for writing valid JSON schema in TypeScript.
- Host: GitHub
- URL: https://github.com/fosfad/json-schema-typescript-definitions
- Owner: fosfad
- License: mit
- Created: 2021-06-24T16:32:42.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-01T03:28:09.000Z (3 months ago)
- Last Synced: 2024-09-23T13:48:18.161Z (about 2 months ago)
- Topics: json-schema, typescript-types
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@fosfad/json-schema-typescript-definitions
- Size: 577 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JSON Schema TypeScript definitions
This package contains TypeScript definitions for JSON Schema. It may be useful in all kind of TypeScript projects that work with JSON Schema directly.
Supported JSON Schema drafts:
- [2020-12](https://json-schema.org/draft/2020-12/json-schema-core.html)
## Getting started
Install the definitions:
```bash
npm install @fosfad/json-schema-typescript-definitions
```Import `JsonSchema` type definition:
```typescript
import { JsonSchema } from '@fosfad/json-schema-typescript-definitions/2020-12';
```## Documentation
### Exported types
The package exports 3 types: `JsonSchemaBoolean`, `JsonSchemaObject` and `JsonSchema`:
- `JsonSchemaBoolean` stands for [Boolean JSON Schema](https://json-schema.org/draft/2020-12/json-schema-core.html#rfc.section.4.3.2);
- `JsonSchemaObject` is an object with all possible JSON Schema keywords within;
- `JsonSchema` is a union type between `JsonSchemaBoolean` and `JsonSchemaObject`.