Debugging Firestone Schemas
While Firestone uses standard JSON Schema, its specific DSL requirements can sometimes trip you up.
Common Firestone-Specific Errors:
-
Missing
keyField:- Error: CLI fails to generate instance commands; OpenAPI paths missing
{id}. - Fix: Ensure your resource schema includes a
keyobject defining the primary identifier.
key: name: user_id schema: { type: string } - Error: CLI fails to generate instance commands; OpenAPI paths missing
-
Invalid Method Names:
- Error: Generation succeeds but endpoints are missing.
- Fix: Use lowercase HTTP verbs in the
methodsblock (get,post,put,delete).
-
Missing
descriptionFields:- Error: Empty help text in CLI; blank descriptions in Swagger UI.
- Fix: Populate
descriptionfor every property and metadata field.
-
Incorrect
type: arrayfor Resources:- Error: "Resource must be an array".
- Fix: Top-level resources in Firestone are collections, so the root schema
typemust bearray, and the item definition goes initems.
Debugging Tips:
- Use
--debug: Runfirestone --debug generate ...to see detailed tracebacks. - Validate Schema: Use an online JSON Schema validator to check syntax errors before running Firestone.