mirror of
https://github.com/LukeHagar/openapi-types.git
synced 2025-12-06 04:20:29 +00:00
Update OpenAPI schemas for versions 2.0, 3.0, 3.1, and 3.2 to enhance clarity and consistency. Introduce new tag object metadata across all schemas, ensuring comprehensive documentation and improved organization. Update bun.lock and package.json for dependency management, and refine README for better guidance on usage and schema validation.
This commit is contained in:
162
README.md
162
README.md
@@ -2,17 +2,7 @@
|
||||
|
||||
Comprehensive TypeScript definitions for all OpenAPI specification versions with detailed JSDoc documentation and version-specific implementations.
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
This library provides **comprehensive TypeScript type definitions** for all OpenAPI specification versions with:
|
||||
|
||||
- **Version-specific implementations** - Each OpenAPI version has its own dedicated folder with complete type definitions
|
||||
- **Modular organization** - Types are organized by OpenAPI object (e.g., `info.ts`, `paths.ts`, `schema.ts`)
|
||||
- **Comprehensive JSDoc** - Every type includes detailed documentation with links to official specifications
|
||||
- **Type safety** - Strict typing that follows OpenAPI specifications exactly
|
||||
- **Discriminated unions** - Advanced TypeScript patterns for schema definitions
|
||||
|
||||
## 📦 Installation
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install oas-types
|
||||
@@ -22,7 +12,17 @@ yarn add oas-types
|
||||
bun add oas-types
|
||||
```
|
||||
|
||||
## 🏗️ Build Process
|
||||
## Architecture
|
||||
|
||||
This library provides comprehensive TypeScript type definitions for all OpenAPI specification versions with:
|
||||
|
||||
- **Version-specific implementations** - Each OpenAPI version has its own dedicated folder with complete type definitions
|
||||
- **Modular organization** - Types are organized by OpenAPI object (e.g., `info.ts`, `paths.ts`, `schema.ts`)
|
||||
- **Comprehensive JSDoc** - Every type includes detailed documentation with links to official specifications
|
||||
- **Type safety** - Strict typing that follows OpenAPI specifications exactly
|
||||
- **Discriminated unions** - Advanced TypeScript patterns for schema definitions
|
||||
|
||||
## Build Process
|
||||
|
||||
This package includes a comprehensive build system that generates JSON schemas from the TypeScript definitions:
|
||||
|
||||
@@ -51,7 +51,7 @@ The build process creates JSON schemas for:
|
||||
import { schemas } from 'oas-types/schemas/3.0';
|
||||
|
||||
// Import all schemas
|
||||
import { allSchemas, getSchemasForVersion } from 'oas-types/schemas';
|
||||
import { allSchemas } from 'oas-types/schemas';
|
||||
|
||||
// Use with JSON Schema validators
|
||||
import Ajv from 'ajv';
|
||||
@@ -59,14 +59,21 @@ const ajv = new Ajv();
|
||||
const validator = ajv.compile(schemas.specification);
|
||||
```
|
||||
|
||||
For detailed build information, see [BUILD.md](./BUILD.md).
|
||||
|
||||
## 🚀 Usage
|
||||
## Usage
|
||||
|
||||
### Import Version-Specific Types
|
||||
|
||||
```typescript
|
||||
// OpenAPI 3.1.x (latest)
|
||||
// OpenAPI 3.2.0 (latest)
|
||||
import {
|
||||
Specification,
|
||||
Info,
|
||||
Paths,
|
||||
Schema,
|
||||
Components
|
||||
} from 'oas-types/3.2';
|
||||
|
||||
// OpenAPI 3.1.x
|
||||
import {
|
||||
Specification,
|
||||
Info,
|
||||
@@ -104,113 +111,83 @@ import { Schema, StringSchema, ObjectSchema } from 'oas-types/3.1/schema';
|
||||
import { SecurityScheme, OAuthFlows } from 'oas-types/3.1/security';
|
||||
```
|
||||
|
||||
### Import Schema Data Types (OpenAPI 3.1.x)
|
||||
### Import Schema Data Types
|
||||
|
||||
```typescript
|
||||
// Import specific schema types for OpenAPI 3.1.x
|
||||
// Import specific schema types for any version
|
||||
import {
|
||||
String,
|
||||
Number,
|
||||
Integer,
|
||||
Boolean,
|
||||
Array,
|
||||
Object,
|
||||
Composition,
|
||||
Reference
|
||||
StringSchema,
|
||||
NumberSchema,
|
||||
IntegerSchema,
|
||||
BooleanSchema,
|
||||
ArraySchema,
|
||||
ObjectSchema,
|
||||
CompositionSchema,
|
||||
ReferenceSchema
|
||||
} from 'oas-types/3.1/data-types';
|
||||
```
|
||||
|
||||
## 📁 Project Structure
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
openapi-types/
|
||||
├── 2.0.0/ # Swagger 2.0 types
|
||||
├── 2.0/ # Swagger 2.0 types
|
||||
│ ├── data-types/ # Schema data types
|
||||
│ │ ├── string.ts # String schema
|
||||
│ │ ├── number.ts # Number schema
|
||||
│ │ ├── integer.ts # Integer schema
|
||||
│ │ ├── boolean.ts # Boolean schema
|
||||
│ │ ├── array.ts # Array schema
|
||||
│ │ ├── object.ts # Object schema
|
||||
│ │ ├── composition.ts # Composition schemas
|
||||
│ │ ├── reference.ts # Reference schema
|
||||
│ │ └── index.ts # Data type exports
|
||||
│ ├── info.ts # Info Object
|
||||
│ ├── paths.ts # Paths and Operations
|
||||
│ ├── schema.ts # Schema definitions
|
||||
│ ├── security.ts # Security schemes
|
||||
│ ├── spec.ts # Main Swagger object
|
||||
│ ├── extensions.ts # Specification extensions
|
||||
│ ├── externalDocs.ts # External documentation
|
||||
│ ├── references.ts # Reference objects
|
||||
│ ├── tags.ts # Tag objects
|
||||
│ ├── xml.ts # XML objects
|
||||
│ ├── example.ts # Example objects
|
||||
│ ├── 2.0.md # Version documentation
|
||||
│ └── index.ts # Version exports
|
||||
│
|
||||
├── 3.0.x/ # OpenAPI 3.0.x types
|
||||
├── 3.0/ # OpenAPI 3.0.x types
|
||||
│ ├── data-types/ # Schema data types
|
||||
│ │ ├── string.ts # String schema
|
||||
│ │ ├── number.ts # Number schema
|
||||
│ │ ├── integer.ts # Integer schema
|
||||
│ │ ├── boolean.ts # Boolean schema
|
||||
│ │ ├── array.ts # Array schema
|
||||
│ │ ├── object.ts # Object schema
|
||||
│ │ ├── composition.ts # Composition schemas
|
||||
│ │ ├── reference.ts # Reference schema
|
||||
│ │ └── index.ts # Data type exports
|
||||
│ ├── info.ts # Info Object
|
||||
│ ├── paths.ts # Paths and Operations
|
||||
│ ├── schema.ts # Schema definitions
|
||||
│ ├── security.ts # Security schemes
|
||||
│ ├── spec.ts # Main OpenAPI object
|
||||
│ ├── components.ts # Components object
|
||||
│ ├── extensions.ts # Specification extensions
|
||||
│ ├── externalDocs.ts # External documentation
|
||||
│ ├── references.ts # Reference objects
|
||||
│ ├── servers.ts # Server objects
|
||||
│ ├── tags.ts # Tag objects
|
||||
│ ├── xml.ts # XML objects
|
||||
│ └── index.ts # Version exports
|
||||
│
|
||||
├── 3.1.x/ # OpenAPI 3.1.x types
|
||||
├── 3.1/ # OpenAPI 3.1.x types
|
||||
│ ├── data-types/ # Individual schema types
|
||||
│ │ ├── string.ts # String schema
|
||||
│ │ ├── number.ts # Number schema
|
||||
│ │ ├── integer.ts # Integer schema
|
||||
│ │ ├── boolean.ts # Boolean schema
|
||||
│ │ ├── array.ts # Array schema
|
||||
│ │ ├── object.ts # Object schema
|
||||
│ │ ├── composition.ts # Composition schemas
|
||||
│ │ ├── reference.ts # Reference schema
|
||||
│ │ └── index.ts # Data type exports
|
||||
│ ├── info.ts # Info Object
|
||||
│ ├── paths.ts # Paths and Operations
|
||||
│ ├── schema.ts # Main Schema union type
|
||||
│ ├── security.ts # Security schemes
|
||||
│ ├── spec.ts # Main OpenAPI object
|
||||
│ ├── components.ts # Components object
|
||||
│ ├── extensions.ts # Specification extensions
|
||||
│ ├── externalDocs.ts # External documentation
|
||||
│ ├── references.ts # Reference objects
|
||||
│ ├── servers.ts # Server objects
|
||||
│ ├── tags.ts # Tag objects
|
||||
│ ├── xml.ts # XML objects
|
||||
│ ├── 3.1.0.md # OpenAPI 3.1.0 documentation
|
||||
│ ├── 3.1.1.md # OpenAPI 3.1.1 documentation
|
||||
│ ├── webhooks.ts # Webhook definitions
|
||||
│ └── index.ts # Version exports
|
||||
│
|
||||
├── 3.2.0/ # OpenAPI 3.2.0 types (in development)
|
||||
│ ├── 3.2.0.md # Version documentation
|
||||
│ └── index.ts # Placeholder exports (not yet implemented)
|
||||
├── 3.2/ # OpenAPI 3.2.0 types
|
||||
│ ├── data-types/ # Schema data types
|
||||
│ ├── info.ts # Info Object
|
||||
│ ├── paths.ts # Paths and Operations
|
||||
│ ├── schema.ts # Schema definitions
|
||||
│ ├── security.ts # Security schemes
|
||||
│ ├── spec.ts # Main OpenAPI object
|
||||
│ ├── components.ts # Components object
|
||||
│ ├── servers.ts # Server objects
|
||||
│ ├── webhooks.ts # Webhook definitions
|
||||
│ ├── oauth.ts # OAuth flow definitions
|
||||
│ └── index.ts # Version exports
|
||||
│
|
||||
├── schemas/ # Generated JSON schemas
|
||||
│ ├── 2.0/ # Swagger 2.0 schemas
|
||||
│ ├── 3.0/ # OpenAPI 3.0 schemas
|
||||
│ ├── 3.1/ # OpenAPI 3.1 schemas
|
||||
│ └── 3.2/ # OpenAPI 3.2 schemas
|
||||
│
|
||||
├── License.ts # SPDX license definitions
|
||||
├── SPDXLicenseList.ts # Complete SPDX license list
|
||||
└── index.ts # Main entry point
|
||||
```
|
||||
|
||||
## 🎯 Philosophy
|
||||
## Philosophy
|
||||
|
||||
### Version-Specific Implementations
|
||||
Each OpenAPI version has its own complete implementation that accurately reflects the specification for that version. This ensures:
|
||||
@@ -231,14 +208,14 @@ Every type includes:
|
||||
- **Usage examples** showing practical implementations
|
||||
- **Property documentation** with example values and constraints
|
||||
|
||||
## 📋 Supported Versions
|
||||
## Supported Versions
|
||||
|
||||
- **Swagger 2.0** (OpenAPI Specification v2.0) - Complete implementation
|
||||
- **OpenAPI 3.0.x** - Complete implementation with all 3.0.x variants
|
||||
- **OpenAPI 3.1.x** - Complete implementation with JSON Schema 2020-12 alignment
|
||||
- **OpenAPI 3.2.0** - In development (not yet available for import)
|
||||
- **OpenAPI 3.2.0** - Complete implementation
|
||||
|
||||
## 🔧 Examples
|
||||
## Examples
|
||||
|
||||
### Basic OpenAPI 3.1.x Usage
|
||||
|
||||
@@ -394,7 +371,7 @@ const oauth2Auth: SecurityScheme = {
|
||||
};
|
||||
```
|
||||
|
||||
## 🧪 Type Safety Features
|
||||
## Type Safety Features
|
||||
|
||||
- **Strict typing** - All types follow OpenAPI specifications exactly
|
||||
- **Version awareness** - Type-safe version-specific features
|
||||
@@ -402,7 +379,7 @@ const oauth2Auth: SecurityScheme = {
|
||||
- **Comprehensive validation** - Property constraints and validation rules
|
||||
- **JSDoc documentation** - Complete documentation with spec links
|
||||
|
||||
## 📚 Documentation
|
||||
## Documentation
|
||||
|
||||
Each type includes comprehensive JSDoc documentation with:
|
||||
- **Official specification links** for each OpenAPI version
|
||||
@@ -411,7 +388,12 @@ Each type includes comprehensive JSDoc documentation with:
|
||||
- **Version compatibility notes** where applicable
|
||||
- **Mutual exclusion rules** for conflicting properties
|
||||
|
||||
## 🔗 Key Features
|
||||
## Key Features
|
||||
|
||||
### OpenAPI 3.2.0 Specific Features
|
||||
- **Latest OpenAPI specification** - Full support for OpenAPI 3.2.0 features
|
||||
- **Enhanced OAuth flows** - Support for all OAuth 2.0 flow types
|
||||
- **Advanced webhook support** - Comprehensive webhook definitions
|
||||
|
||||
### OpenAPI 3.1.x Specific Features
|
||||
- **JSON Schema 2020-12 alignment** - Full support for latest JSON Schema features
|
||||
@@ -429,7 +411,7 @@ Each type includes comprehensive JSDoc documentation with:
|
||||
- **Security definitions** - Support for security schemes
|
||||
- **Response definitions** - Support for reusable response definitions
|
||||
|
||||
## 🤝 Contributing
|
||||
## Contributing
|
||||
|
||||
Contributions are welcome! Please ensure that:
|
||||
- All types follow the OpenAPI specification exactly
|
||||
@@ -437,11 +419,11 @@ Contributions are welcome! Please ensure that:
|
||||
- Version compatibility is maintained
|
||||
- Tests are added for new features
|
||||
|
||||
## 📄 License
|
||||
## License
|
||||
|
||||
MIT License - see LICENSE file for details.
|
||||
|
||||
## 🔗 Links
|
||||
## Links
|
||||
|
||||
- [OpenAPI Specification](https://spec.openapis.org/)
|
||||
- [Swagger Specification](https://swagger.io/specification/)
|
||||
|
||||
11
bun.lock
11
bun.lock
@@ -5,15 +5,14 @@
|
||||
"name": "openapi-types",
|
||||
"dependencies": {
|
||||
"ajv": "^8.17.1",
|
||||
"rimraf": "^6.0.1",
|
||||
"spdx-license-list": "^6.10.0",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.2.4",
|
||||
"@types/bun": "^1.2.23",
|
||||
"rimraf": "^6.0.1",
|
||||
"ts-json-schema-generator": "^2.4.0",
|
||||
"tsd": "^0.33.0",
|
||||
"typescript": "^5.9.2",
|
||||
"typescript": "^5.9.3",
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5.0.0",
|
||||
@@ -295,8 +294,6 @@
|
||||
|
||||
"spdx-license-ids": ["spdx-license-ids@3.0.22", "", {}, "sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ=="],
|
||||
|
||||
"spdx-license-list": ["spdx-license-list@6.10.0", "", {}, "sha512-wF3RhDFoqdu14d1Prv6c8aNU0FSRuSFJpNjWeygIZcNZEwPxp7I5/Hwo8j6lSkBKWAIkSQrKefrC5N0lvOP0Gw=="],
|
||||
|
||||
"string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
|
||||
|
||||
"string-width-cjs": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
|
||||
@@ -325,7 +322,7 @@
|
||||
|
||||
"type-fest": ["type-fest@0.18.1", "", {}, "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw=="],
|
||||
|
||||
"typescript": ["typescript@5.9.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A=="],
|
||||
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
|
||||
|
||||
"undici-types": ["undici-types@7.11.0", "", {}, "sha512-kt1ZriHTi7MU+Z/r9DOdAI3ONdaR3M3csEaRc6ewa4f4dTvX4cQCbJ4NkEn0ohE4hHtq85+PhPSTY+pO/1PwgA=="],
|
||||
|
||||
@@ -359,6 +356,8 @@
|
||||
|
||||
"read-pkg-up/type-fest": ["type-fest@0.8.1", "", {}, "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA=="],
|
||||
|
||||
"ts-json-schema-generator/typescript": ["typescript@5.9.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A=="],
|
||||
|
||||
"wrap-ansi/ansi-styles": ["ansi-styles@6.2.3", "", {}, "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg=="],
|
||||
|
||||
"wrap-ansi/string-width": ["string-width@5.1.2", "", { "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" } }, "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA=="],
|
||||
|
||||
1
index.ts
1
index.ts
@@ -33,3 +33,4 @@ export * as OpenAPI2 from "./2.0";
|
||||
export * as OpenAPI3 from "./3.0";
|
||||
export * as OpenAPI3_1 from "./3.1";
|
||||
export * as OpenAPI3_2 from "./3.2";
|
||||
export * as schemas from "./schemas";
|
||||
|
||||
250
package.json
250
package.json
@@ -1,128 +1,126 @@
|
||||
{
|
||||
"name": "oas-types",
|
||||
"version": "1.0.1",
|
||||
"description": "Comprehensive TypeScript definitions for all OpenAPI specification versions (Swagger 2.0, OpenAPI 3.0, 3.1, 3.2)",
|
||||
"main": "index.ts",
|
||||
"module": "index.ts",
|
||||
"type": "module",
|
||||
"types": "index.ts",
|
||||
"author": {
|
||||
"name": "Luke Hagar",
|
||||
"email": "lukeslakemail@gmail.com",
|
||||
"url": "https://lukehagar.com/"
|
||||
},
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/lukehagar/openapi-types.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/lukehagar/openapi-types/issues"
|
||||
},
|
||||
"homepage": "https://github.com/lukehagar/openapi-types#readme",
|
||||
"scripts": {
|
||||
"test": "bun test",
|
||||
"test:watch": "bun test --watch",
|
||||
"test:coverage": "bun test --coverage",
|
||||
"test:common": "bun test tests/common.test.ts",
|
||||
"test:open-enums": "bun test tests/open-enums.test.ts",
|
||||
"test:swagger-2.0": "bun test tests/swagger-2.0.test.ts",
|
||||
"test:openapi-3.0.0": "bun test tests/openapi-3.0.0.test.ts",
|
||||
"test:integration": "bun test tests/integration.test.ts",
|
||||
"type-check": "tsc --noEmit",
|
||||
"build": "bun run build.ts",
|
||||
"build:schemas": "bun run build.ts",
|
||||
"dev": "bun run --watch index.ts",
|
||||
"lint": "biome check .",
|
||||
"lint:fix": "biome check --write .",
|
||||
"test:version": "node scripts/test-version-comparison.js",
|
||||
"schemas:clean": "rm -rf schemas/",
|
||||
"schemas:validate": "echo 'Schema validation not yet implemented'"
|
||||
},
|
||||
"dependencies": {
|
||||
"ajv": "^8.17.1",
|
||||
"rimraf": "^6.0.1",
|
||||
"spdx-license-list": "^6.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.2.4",
|
||||
"@types/bun": "^1.2.23",
|
||||
"ts-json-schema-generator": "^2.4.0",
|
||||
"tsd": "^0.33.0",
|
||||
"typescript": "^5.9.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./index.ts",
|
||||
"import": "./index.ts"
|
||||
},
|
||||
"./2.0": {
|
||||
"types": "./2.0/index.ts",
|
||||
"import": "./2.0/index.ts"
|
||||
},
|
||||
"./3.0": {
|
||||
"types": "./3.0/index.ts",
|
||||
"import": "./3.0/index.ts"
|
||||
},
|
||||
"./3.1": {
|
||||
"types": "./3.1/index.ts",
|
||||
"import": "./3.1/index.ts"
|
||||
},
|
||||
"./3.2": {
|
||||
"types": "./3.2/index.ts",
|
||||
"import": "./3.2/index.ts"
|
||||
},
|
||||
"./schemas": {
|
||||
"types": "./schemas/index.ts",
|
||||
"import": "./schemas/index.ts"
|
||||
},
|
||||
"./schemas/2.0": {
|
||||
"types": "./schemas/2.0/index.ts",
|
||||
"import": "./schemas/2.0/index.ts"
|
||||
},
|
||||
"./schemas/3.0": {
|
||||
"types": "./schemas/3.0/index.ts",
|
||||
"import": "./schemas/3.0/index.ts"
|
||||
},
|
||||
"./schemas/3.1": {
|
||||
"types": "./schemas/3.1/index.ts",
|
||||
"import": "./schemas/3.1/index.ts"
|
||||
},
|
||||
"./schemas/3.2": {
|
||||
"types": "./schemas/3.2/index.ts",
|
||||
"import": "./schemas/3.2/index.ts"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"2.0/",
|
||||
"3.0/",
|
||||
"3.1/",
|
||||
"3.2/",
|
||||
"schemas/",
|
||||
"License.ts",
|
||||
"SPDXLicenseList.ts",
|
||||
"MIGRATION.md",
|
||||
"index.ts",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"keywords": [
|
||||
"openapi",
|
||||
"swagger",
|
||||
"typescript",
|
||||
"types",
|
||||
"definitions",
|
||||
"api",
|
||||
"specification",
|
||||
"swagger-2.0",
|
||||
"openapi-3.0",
|
||||
"openapi-3.1",
|
||||
"openapi-3.2",
|
||||
"json-schema",
|
||||
"rest",
|
||||
"api-documentation"
|
||||
]
|
||||
"name": "oas-types",
|
||||
"version": "1.0.5",
|
||||
"description": "Comprehensive TypeScript definitions for all OpenAPI specification versions (Swagger 2.0, OpenAPI 3.0, 3.1, 3.2)",
|
||||
"main": "index.ts",
|
||||
"module": "index.ts",
|
||||
"type": "module",
|
||||
"types": "index.ts",
|
||||
"author": {
|
||||
"name": "Luke Hagar",
|
||||
"email": "lukeslakemail@gmail.com",
|
||||
"url": "https://lukehagar.com/"
|
||||
},
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/lukehagar/openapi-types.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/lukehagar/openapi-types/issues"
|
||||
},
|
||||
"homepage": "https://github.com/lukehagar/openapi-types#readme",
|
||||
"scripts": {
|
||||
"test": "bun test",
|
||||
"test:watch": "bun test --watch",
|
||||
"test:coverage": "bun test --coverage",
|
||||
"test:common": "bun test tests/common.test.ts",
|
||||
"test:open-enums": "bun test tests/open-enums.test.ts",
|
||||
"test:swagger-2.0": "bun test tests/swagger-2.0.test.ts",
|
||||
"test:openapi-3.0.0": "bun test tests/openapi-3.0.0.test.ts",
|
||||
"test:integration": "bun test tests/integration.test.ts",
|
||||
"type-check": "tsc --noEmit",
|
||||
"build": "bun run build.ts",
|
||||
"build:schemas": "bun run build.ts",
|
||||
"dev": "bun run --watch index.ts",
|
||||
"lint": "biome check .",
|
||||
"lint:fix": "biome check --write .",
|
||||
"test:version": "node scripts/test-version-comparison.js",
|
||||
"schemas:clean": "rm -rf schemas/",
|
||||
"schemas:validate": "echo 'Schema validation not yet implemented'"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.2.4",
|
||||
"@types/bun": "^1.2.23",
|
||||
"ajv": "^8.17.1",
|
||||
"rimraf": "^6.0.1",
|
||||
"ts-json-schema-generator": "^2.4.0",
|
||||
"tsd": "^0.33.0",
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./index.ts",
|
||||
"import": "./index.ts"
|
||||
},
|
||||
"./2.0": {
|
||||
"types": "./2.0/index.ts",
|
||||
"import": "./2.0/index.ts"
|
||||
},
|
||||
"./3.0": {
|
||||
"types": "./3.0/index.ts",
|
||||
"import": "./3.0/index.ts"
|
||||
},
|
||||
"./3.1": {
|
||||
"types": "./3.1/index.ts",
|
||||
"import": "./3.1/index.ts"
|
||||
},
|
||||
"./3.2": {
|
||||
"types": "./3.2/index.ts",
|
||||
"import": "./3.2/index.ts"
|
||||
},
|
||||
"./schemas": {
|
||||
"types": "./schemas/index.ts",
|
||||
"import": "./schemas/index.ts"
|
||||
},
|
||||
"./schemas/2.0": {
|
||||
"types": "./schemas/2.0/index.ts",
|
||||
"import": "./schemas/2.0/index.ts"
|
||||
},
|
||||
"./schemas/3.0": {
|
||||
"types": "./schemas/3.0/index.ts",
|
||||
"import": "./schemas/3.0/index.ts"
|
||||
},
|
||||
"./schemas/3.1": {
|
||||
"types": "./schemas/3.1/index.ts",
|
||||
"import": "./schemas/3.1/index.ts"
|
||||
},
|
||||
"./schemas/3.2": {
|
||||
"types": "./schemas/3.2/index.ts",
|
||||
"import": "./schemas/3.2/index.ts"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"2.0/",
|
||||
"3.0/",
|
||||
"3.1/",
|
||||
"3.2/",
|
||||
"schemas/",
|
||||
"License.ts",
|
||||
"SPDXLicenseList.ts",
|
||||
"MIGRATION.md",
|
||||
"index.ts",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"keywords": [
|
||||
"openapi",
|
||||
"swagger",
|
||||
"typescript",
|
||||
"types",
|
||||
"definitions",
|
||||
"api",
|
||||
"specification",
|
||||
"swagger-2.0",
|
||||
"openapi-3.0",
|
||||
"openapi-3.1",
|
||||
"openapi-3.2",
|
||||
"json-schema",
|
||||
"rest",
|
||||
"api-documentation"
|
||||
]
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -5,25 +5,27 @@
|
||||
* These schemas can be used to validate OpenAPI 2.0 documents and components.
|
||||
*/
|
||||
|
||||
export { default as parameter } from "./components/parameter.json";
|
||||
export { default as pathitem } from "./components/pathitem.json";
|
||||
// Component schemas
|
||||
export { default as response } from "./components/response.json";
|
||||
export { default as schema } from "./components/schema.json";
|
||||
export { default as specification } from "./main/specification.json";
|
||||
|
||||
import parameter from "./components/parameter.json";
|
||||
import pathitem from "./components/pathitem.json";
|
||||
import response from "./components/response.json";
|
||||
import schema from "./components/schema.json";
|
||||
// Component schemas
|
||||
export { default as response } from "./components/response.json";
|
||||
export { default as parameter } from "./components/parameter.json";
|
||||
export { default as schema } from "./components/schema.json";
|
||||
export { default as pathitem } from "./components/pathitem.json";
|
||||
|
||||
// Import all schemas for internal use
|
||||
import specification from "./main/specification.json";
|
||||
import response from "./components/response.json";
|
||||
import parameter from "./components/parameter.json";
|
||||
import schema from "./components/schema.json";
|
||||
import pathitem from "./components/pathitem.json";
|
||||
|
||||
// Re-export all schemas as a single object for convenience
|
||||
export const schemas = {
|
||||
specification,
|
||||
response,
|
||||
parameter,
|
||||
schema,
|
||||
pathitem,
|
||||
specification,
|
||||
response,
|
||||
parameter,
|
||||
schema,
|
||||
pathitem,
|
||||
} as const;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -5,40 +5,45 @@
|
||||
* These schemas can be used to validate OpenAPI 3.0 documents and components.
|
||||
*/
|
||||
|
||||
export { default as callback } from "./components/callback.json";
|
||||
export { default as example } from "./components/example.json";
|
||||
export { default as header } from "./components/header.json";
|
||||
export { default as link } from "./components/link.json";
|
||||
export { default as parameter } from "./components/parameter.json";
|
||||
export { default as requestbody } from "./components/requestbody.json";
|
||||
// Component schemas
|
||||
export { default as response } from "./components/response.json";
|
||||
export { default as schema } from "./components/schema.json";
|
||||
export { default as securityscheme } from "./components/securityscheme.json";
|
||||
export { default as specification } from "./main/specification.json";
|
||||
|
||||
import callback from "./components/callback.json";
|
||||
import example from "./components/example.json";
|
||||
import header from "./components/header.json";
|
||||
import link from "./components/link.json";
|
||||
import parameter from "./components/parameter.json";
|
||||
import requestbody from "./components/requestbody.json";
|
||||
import response from "./components/response.json";
|
||||
import schema from "./components/schema.json";
|
||||
import securityscheme from "./components/securityscheme.json";
|
||||
// Component schemas
|
||||
export { default as response } from "./components/response.json";
|
||||
export { default as link } from "./components/link.json";
|
||||
export { default as requestbody } from "./components/requestbody.json";
|
||||
export { default as example } from "./components/example.json";
|
||||
export { default as parameter } from "./components/parameter.json";
|
||||
export { default as schema } from "./components/schema.json";
|
||||
export { default as securityscheme } from "./components/securityscheme.json";
|
||||
export { default as header } from "./components/header.json";
|
||||
export { default as callback } from "./components/callback.json";
|
||||
export { default as pathitem } from "./components/pathitem.json";
|
||||
|
||||
// Import all schemas for internal use
|
||||
import specification from "./main/specification.json";
|
||||
import response from "./components/response.json";
|
||||
import link from "./components/link.json";
|
||||
import requestbody from "./components/requestbody.json";
|
||||
import example from "./components/example.json";
|
||||
import parameter from "./components/parameter.json";
|
||||
import schema from "./components/schema.json";
|
||||
import securityscheme from "./components/securityscheme.json";
|
||||
import header from "./components/header.json";
|
||||
import callback from "./components/callback.json";
|
||||
import pathitem from "./components/pathitem.json";
|
||||
|
||||
// Re-export all schemas as a single object for convenience
|
||||
export const schemas = {
|
||||
specification,
|
||||
response,
|
||||
link,
|
||||
requestbody,
|
||||
example,
|
||||
parameter,
|
||||
schema,
|
||||
securityscheme,
|
||||
header,
|
||||
callback,
|
||||
specification,
|
||||
response,
|
||||
link,
|
||||
requestbody,
|
||||
example,
|
||||
parameter,
|
||||
schema,
|
||||
securityscheme,
|
||||
header,
|
||||
callback,
|
||||
pathitem,
|
||||
} as const;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -5,43 +5,45 @@
|
||||
* These schemas can be used to validate OpenAPI 3.1 documents and components.
|
||||
*/
|
||||
|
||||
export { default as callback } from "./components/callback.json";
|
||||
export { default as example } from "./components/example.json";
|
||||
export { default as header } from "./components/header.json";
|
||||
export { default as link } from "./components/link.json";
|
||||
export { default as parameter } from "./components/parameter.json";
|
||||
export { default as pathitem } from "./components/pathitem.json";
|
||||
export { default as requestbody } from "./components/requestbody.json";
|
||||
// Component schemas
|
||||
export { default as response } from "./components/response.json";
|
||||
export { default as schema } from "./components/schema.json";
|
||||
export { default as securityscheme } from "./components/securityscheme.json";
|
||||
export { default as specification } from "./main/specification.json";
|
||||
|
||||
import callback from "./components/callback.json";
|
||||
import example from "./components/example.json";
|
||||
import header from "./components/header.json";
|
||||
import link from "./components/link.json";
|
||||
import parameter from "./components/parameter.json";
|
||||
import pathitem from "./components/pathitem.json";
|
||||
import requestbody from "./components/requestbody.json";
|
||||
import response from "./components/response.json";
|
||||
import schema from "./components/schema.json";
|
||||
import securityscheme from "./components/securityscheme.json";
|
||||
// Component schemas
|
||||
export { default as response } from "./components/response.json";
|
||||
export { default as link } from "./components/link.json";
|
||||
export { default as requestbody } from "./components/requestbody.json";
|
||||
export { default as example } from "./components/example.json";
|
||||
export { default as parameter } from "./components/parameter.json";
|
||||
export { default as schema } from "./components/schema.json";
|
||||
export { default as securityscheme } from "./components/securityscheme.json";
|
||||
export { default as header } from "./components/header.json";
|
||||
export { default as callback } from "./components/callback.json";
|
||||
export { default as pathitem } from "./components/pathitem.json";
|
||||
|
||||
// Import all schemas for internal use
|
||||
import specification from "./main/specification.json";
|
||||
import response from "./components/response.json";
|
||||
import link from "./components/link.json";
|
||||
import requestbody from "./components/requestbody.json";
|
||||
import example from "./components/example.json";
|
||||
import parameter from "./components/parameter.json";
|
||||
import schema from "./components/schema.json";
|
||||
import securityscheme from "./components/securityscheme.json";
|
||||
import header from "./components/header.json";
|
||||
import callback from "./components/callback.json";
|
||||
import pathitem from "./components/pathitem.json";
|
||||
|
||||
// Re-export all schemas as a single object for convenience
|
||||
export const schemas = {
|
||||
specification,
|
||||
response,
|
||||
link,
|
||||
requestbody,
|
||||
example,
|
||||
parameter,
|
||||
schema,
|
||||
securityscheme,
|
||||
header,
|
||||
callback,
|
||||
pathitem,
|
||||
specification,
|
||||
response,
|
||||
link,
|
||||
requestbody,
|
||||
example,
|
||||
parameter,
|
||||
schema,
|
||||
securityscheme,
|
||||
header,
|
||||
callback,
|
||||
pathitem,
|
||||
} as const;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -5,46 +5,48 @@
|
||||
* These schemas can be used to validate OpenAPI 3.2 documents and components.
|
||||
*/
|
||||
|
||||
export { default as callback } from "./components/callback.json";
|
||||
export { default as example } from "./components/example.json";
|
||||
export { default as header } from "./components/header.json";
|
||||
export { default as link } from "./components/link.json";
|
||||
export { default as mediatype } from "./components/mediatype.json";
|
||||
export { default as parameter } from "./components/parameter.json";
|
||||
export { default as pathitem } from "./components/pathitem.json";
|
||||
export { default as requestbody } from "./components/requestbody.json";
|
||||
// Component schemas
|
||||
export { default as response } from "./components/response.json";
|
||||
export { default as schema } from "./components/schema.json";
|
||||
export { default as securityscheme } from "./components/securityscheme.json";
|
||||
export { default as specification } from "./main/specification.json";
|
||||
|
||||
import callback from "./components/callback.json";
|
||||
import example from "./components/example.json";
|
||||
import header from "./components/header.json";
|
||||
import link from "./components/link.json";
|
||||
import mediatype from "./components/mediatype.json";
|
||||
import parameter from "./components/parameter.json";
|
||||
import pathitem from "./components/pathitem.json";
|
||||
import requestbody from "./components/requestbody.json";
|
||||
import response from "./components/response.json";
|
||||
import schema from "./components/schema.json";
|
||||
import securityscheme from "./components/securityscheme.json";
|
||||
// Component schemas
|
||||
export { default as response } from "./components/response.json";
|
||||
export { default as link } from "./components/link.json";
|
||||
export { default as requestbody } from "./components/requestbody.json";
|
||||
export { default as example } from "./components/example.json";
|
||||
export { default as parameter } from "./components/parameter.json";
|
||||
export { default as schema } from "./components/schema.json";
|
||||
export { default as mediatype } from "./components/mediatype.json";
|
||||
export { default as securityscheme } from "./components/securityscheme.json";
|
||||
export { default as header } from "./components/header.json";
|
||||
export { default as callback } from "./components/callback.json";
|
||||
export { default as pathitem } from "./components/pathitem.json";
|
||||
|
||||
// Import all schemas for internal use
|
||||
import specification from "./main/specification.json";
|
||||
import response from "./components/response.json";
|
||||
import link from "./components/link.json";
|
||||
import requestbody from "./components/requestbody.json";
|
||||
import example from "./components/example.json";
|
||||
import parameter from "./components/parameter.json";
|
||||
import schema from "./components/schema.json";
|
||||
import mediatype from "./components/mediatype.json";
|
||||
import securityscheme from "./components/securityscheme.json";
|
||||
import header from "./components/header.json";
|
||||
import callback from "./components/callback.json";
|
||||
import pathitem from "./components/pathitem.json";
|
||||
|
||||
// Re-export all schemas as a single object for convenience
|
||||
export const schemas = {
|
||||
specification,
|
||||
response,
|
||||
link,
|
||||
requestbody,
|
||||
example,
|
||||
parameter,
|
||||
schema,
|
||||
mediatype,
|
||||
securityscheme,
|
||||
header,
|
||||
callback,
|
||||
pathitem,
|
||||
specification,
|
||||
response,
|
||||
link,
|
||||
requestbody,
|
||||
example,
|
||||
parameter,
|
||||
schema,
|
||||
mediatype,
|
||||
securityscheme,
|
||||
header,
|
||||
callback,
|
||||
pathitem,
|
||||
} as const;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,8 +18,8 @@ import { schemas as schemas3_2 } from "./3.2";
|
||||
|
||||
// Export all schemas in a single object organized by version
|
||||
export const allSchemas = {
|
||||
"2.0": schemas2_0,
|
||||
"3.0": schemas3_0,
|
||||
"3.1": schemas3_1,
|
||||
"3.2": schemas3_2,
|
||||
"2.0": schemas2_0,
|
||||
"3.0": schemas3_0,
|
||||
"3.1": schemas3_1,
|
||||
"3.2": schemas3_2,
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user