JSON API Practices
Application skill for JSON style learning (from the archived awesome-guidelines style capsules). For HTTP resource design and versioning policy, load api-design-practices.
Core Principle
JSON APIs are strict JSON with predictable names and envelopes, camelCase properties, standard string formats, and a consistent success/error shape when using the Google pattern.
When to Use / NOT
- Public JSON request/response bodies, RPC wrappers, fixture files, OpenAPI examples.
- Reviewing API compatibility and reserved property usage.
NOT when:
- Non-JSON serialization (Protobuf, MessagePack), use stack conventions.
- Internal-only config JSON with project-specific rules, document divergence.
Workflow
- Syntax, quotes, camelCase, plural arrays, omit null (
json-style-syntax-properties.md).
- Types, enums, dates, durations, geo (
json-style-types-formats.md).
- Envelope, apiVersion, data/error, kind/items ordering (
json-style-envelope-errors.md).
- Maps & paging, map docs, paging links, ordering (
json-style-maps-paging.md).
- Verify, JSON parse + schema/OpenAPI validation on fixtures and samples.
Red Flags
- Comments or trailing commas in JSON
- snake_case keys on JS-facing APIs
- Numeric enums without migration story
- Both
data and error present
- Reserved names reused (
items, kind, error)
- Non-RFC3339 date strings
- JS
undefined serialized as null inconsistently
Verification
jq / python -m json.tool on fixtures
- OpenAPI/JSON Schema validation
- Contract tests for envelope + error shape
- Capsule checklist on API review
References
awesome-guidelines/references/json-style-learning-note.md
awesome-guidelines/references/json-style-syntax-properties.md
awesome-guidelines/references/json-style-types-formats.md
awesome-guidelines/references/json-style-envelope-errors.md
awesome-guidelines/references/json-style-maps-paging.md
1---2name: json-api-practices3description: Use when authoring or reviewing JSON API payloads, strict JSON syntax, camelCase properties, string enums, RFC3339 dates, Google-style data/error envelope, and paging reserved names.4---56# JSON API Practices78Application skill for JSON style learning (from the archived `awesome-guidelines` style capsules). For HTTP resource design and versioning policy, load `api-design-practices`.910## Core Principle1112JSON APIs are **strict JSON with predictable names and envelopes**, camelCase properties, standard string formats, and a consistent success/error shape when using the Google pattern.1314## When to Use / NOT1516- Public JSON request/response bodies, RPC wrappers, fixture files, OpenAPI examples.17- Reviewing API compatibility and reserved property usage.1819**NOT when:**2021- Non-JSON serialization (Protobuf, MessagePack), use stack conventions.22- Internal-only config JSON with project-specific rules, document divergence.2324## Workflow25261. **Syntax**, quotes, camelCase, plural arrays, omit null (`json-style-syntax-properties.md`).272. **Types**, enums, dates, durations, geo (`json-style-types-formats.md`).283. **Envelope**, apiVersion, data/error, kind/items ordering (`json-style-envelope-errors.md`).294. **Maps & paging**, map docs, paging links, ordering (`json-style-maps-paging.md`).305. **Verify**, JSON parse + schema/OpenAPI validation on fixtures and samples.3132## Red Flags3334- Comments or trailing commas in JSON35- snake_case keys on JS-facing APIs36- Numeric enums without migration story37- Both `data` and `error` present38- Reserved names reused (`items`, `kind`, `error`)39- Non-RFC3339 date strings40- JS `undefined` serialized as null inconsistently4142## Verification4344- `jq` / `python -m json.tool` on fixtures45- OpenAPI/JSON Schema validation46- Contract tests for envelope + error shape47- Capsule checklist on API review484950## References5152- `awesome-guidelines/references/json-style-learning-note.md`53- `awesome-guidelines/references/json-style-syntax-properties.md`54- `awesome-guidelines/references/json-style-types-formats.md`55- `awesome-guidelines/references/json-style-envelope-errors.md`56- `awesome-guidelines/references/json-style-maps-paging.md`