Download the PHP package dandoetech/openapi-generator without Composer
On this page you can find all versions of the php package dandoetech/openapi-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dandoetech/openapi-generator
More information about dandoetech/openapi-generator
Files in dandoetech/openapi-generator
Package openapi-generator
Short Description Generate OpenAPI 3.1 from DanDoeTech Resource Registry with optional model metadata fallback.
License MIT
Homepage https://github.com/dandoetech/openapi-generator
Informations about the package openapi-generator
DanDoeTech OpenAPI Generator
Pre-release — Architecture by senior tech lead, implementation largely AI-assisted with human review. Not fully reviewed. Architecture may change before v1.0.0.
Generate OpenAPI 3.1 specifications from a Resource Registry. Framework-agnostic — no Laravel required.
Installation
Requires dandoetech/resource-registry.
Quick Start
Output (abbreviated):
Laravel users: Use
dandoetech/laravel-openapi-generatorfor Artisan commands and automatic registry binding.
API Overview
| Class | Purpose |
|---|---|
OpenApiGenerator |
Main entry point — generate(Registry): OpenApiDocument |
OpenApiDocument |
Result container — toArray() and toJson() |
ResourceResolver |
Resolves fields from resource definitions with optional fallback |
PathsBuilder |
Builds OpenAPI path items from resource definitions |
ComponentsBuilder |
Builds component schemas from resource fields |
SchemaFactory |
Maps fields and computed fields to JSON Schema properties |
Types |
Maps FieldType enum to OpenAPI type/format pairs |
Contracts
| Interface | Purpose |
|---|---|
OpenApiGeneratorInterface |
generate(Registry): OpenApiDocument |
ModelMetaProviderInterface |
Optional fallback for field metadata — fieldsFor(string $key): array |
Type Mapping
| FieldType | OpenAPI |
|---|---|
String |
{ "type": "string" } |
Integer |
{ "type": "integer", "format": "int64" } |
Float |
{ "type": "number", "format": "double" } |
Boolean |
{ "type": "boolean" } |
DateTime |
{ "type": "string", "format": "date-time" } |
Json |
{ "type": "object" } |
Date |
{ "type": "string", "format": "date" } |
Text |
{ "type": "string" } |
Email |
{ "type": "string", "format": "email" } |
Url |
{ "type": "string", "format": "uri" } |
Enum |
{ "type": "string" } |
Configuration
All configuration is via constructor arguments:
Field Fallback
If a resource has no fields defined, the generator can fall back to a ModelMetaProviderInterface:
Testing
License
MIT