flutter_api_contract 0.1.0
flutter_api_contract: ^0.1.0 copied to clipboard
Catch drift between your Dart/Flutter models and the backend's OpenAPI or Swagger schema before it crashes in production.
Changelog #
0.1.0 #
First release.
- Reads OpenAPI 3.0 / 3.1 and Swagger 2.0 specs, JSON or YAML, from a file or a URL
(with
--headerfor protected docs). - Reads Dart models with
package:analyzer: hand-writtenfromJson(json['key'], casts,??, null guards, nestedjson['a']['b'], aliases, enums viavalues.byName/firstWhere(orElse:)),json_serializable(@JsonKey, class andbuild.yamlfield_rename, constructor defaults,unknownEnumValue, converters) andfreezed(@Default,@JsonKey, unions). - Pairs models with schemas by name (suffixes stripped), by explicit mapping or by endpoint
(
GET /me#data). - Findings:
missing-in-schema(with a rename suggestion),required-ignored,nullable-mismatch,type-mismatch,enum-unhandled,enum-extra,unmatched-model,unknown-schema. - Output as text, Markdown, JSON or GitHub annotations; exit code 1 on errors
(
--fail-on). - Shrink-only baseline (
--baseline,--update-baseline).