firevel/api-resource-schema-generator

Maintainers

Package info

github.com/firevel/api-resource-schema-generator

pkg:composer/firevel/api-resource-schema-generator

Transparency log

Statistics

Installs: 2 026

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.3.0 2026-06-30 18:31 UTC

README

Generates JSON schema files for API resources using Firevel Generator.

Usage

Single resource:

php artisan firevel:generate api-resource-schema --json=resource.json

Output: schemas/api-resources/{name}/schema.json

Multiple resources:

php artisan firevel:generate api-resource-schemas --json=resources.json

Output: schemas/app.json

Schema → code in one step

The pipelines above only produce schema JSON, which you then feed to the generator. The *-from-schema pipelines collapse both stages into a single command: they transform the prompt-style schema and generate the resource code (model, migration, transformer, controller, requests, factory, seeder, policy, route).

Single resource — bare { "name": ..., "fields": [...] } input:

php artisan firevel:generate api-resource-from-schema --json=resource.json

Multiple resources{ "schemas": [ ... ] } input (plus optional seeders):

php artisan firevel:generate api-resources-from-schema --json=resources.json

Both accept the standard flags (--only, --dry-run, --skip-existing). The intermediate generator-format descriptor is written to the system temp directory (the path is logged) for inspection — nothing is added under schemas/. Code generation runs the api-resource pipeline (resource files only); it does not run the app-level steps (routes consolidation, morph map, composer requires, .env).