implementing-openapi-in-dart
Installation
SKILL.md
Implementing OpenAPI 3.0 in Dart
Given an OpenAPI 3.0 spec, implement a type-safe Dart API layer with:
- Freezed (or Equatable) for models
- Dio for HTTP with interceptors and error handling
- json_serializable for JSON serialisation
Process
- Read the OpenAPI spec — parse
components/schemasfor models,pathsfor endpoints. - Map schemas → Dart models (Freezed or Equatable — see Model Strategy).
- Map paths → Dio service methods.
- Add a repository layer that wraps the service.
- Wire error handling via
DioException→ domainApiError.