api
dart run stackchain api openapi.yamldart run stackchain api # refresh from last specReads OpenAPI 3 schemas and writes:
lib/core/api/models/<name>_model.dartlib/core/api/repositories/<name>_api_repository.dartlib/core/api/api.dartWhen the backend changes DTOs, re-run api instead of hand-editing models. Code inside // <stackchain:custom> is kept.
Honest limits
Section titled “Honest limits”- Uses
components.schemas(not full path/operation codegen yet) - Repos default to
/<schema_snake>— adjust in custom if your API differs - Does not auto-wire DI/routes; register or import where you need them
Safe re-run
Section titled “Safe re-run”| Region | Behavior |
|---|---|
// <stackchain:generated> |
Refreshed |
// <stackchain:custom> |
Preserved |
Last spec path is stored in .stackchain/openapi.yaml.
Options
Section titled “Options”| Flag | Meaning |
|---|---|
--spec, -s |
Spec path (or pass as positional) |
--overwrite, -f |
Force refresh owned files |
--dry-run |
Preview only |
--skip-analyze |
Skip analyzer |