Style Conventions
June 2, 2026 · View on GitHub
YAML File Format
When editing OpenAPI YAML files, follow these conventions:
- Use
$reffor shared models rather than inline definitions - Include
descriptionon every field - Use
x-stoplight: id:annotations if present on surrounding fields (Stoplight auto-generates these) - Keep
requiredarrays up to date
Field Type Conventions
- File names:
snake_case.yamlfor shared models - Enum values:
snake_case - UUID fields:
type: string, format: uuid - Timestamps:
$ref: ./timestamp.yaml - Geographic fields:
$reftogeoJSON_point.yaml,geoJSON_polygon.yaml, orgeoJSON_linestring.yaml - Arrays of references:
type: arraywithitems: { $ref: ./some_model.yaml }
Adding a New Shared Model
- Create the YAML file in
Shared Data Models/ - Add a
$reffrom any model or API that uses it - Add an entry to
toc.jsonunder the appropriate section - Verify the
$refpath is correct relative to the referencing file
Key Gotchas
- $ref paths are relative to the file containing the reference. API files use
../Shared Data Models/foo.yaml; shared models use./foo.yaml. - Spaces in file names:
Curbs API.yamlhas a space — use URL encoding (Curbs%20API.yaml) in Markdown links but literal paths in$ref. - toc.json controls what appears in the Stoplight browser — new models won't show up until added here.
- x-stoplight IDs are auto-generated by the Stoplight editor. When adding fields by hand, you can omit them and Stoplight will generate them later, or include them for consistency.
- 501 responses must be documented on all optional endpoints per the CDS spec pattern.