openapi_flutter_gen 0.2.17
openapi_flutter_gen: ^0.2.17 copied to clipboard
Zero build_runner OpenAPI-to-Dart code generator. Produces immutable models, sealed exhaustive responses, typed auth interceptors, pagination, and Isolate-based deserialization.
0.2.17 #
- Fix (allOf composition): composed (
allOf) models now keep ALL inherited properties from their$ref'd base chain at any nesting depth, plus their own — previously every inherited field was silently dropped. Two independent gaps closed: (1)SwaggerNormalizerwas discardingallOf/oneOf/anyOfentirely when converting Swagger 2.0 definitions, so the parser never saw the composition; (2) the model generator ignoredallOfRefs($refbases) and only emitted inline/own props. Now the base chain is resolved (parser links each allOf ref to its target) and merged (generator folds bases-first, own-last, derived wins on name clash). E.g. Azure DevOpsWorkItem5→7,BuildDefinition19→38; flat schemas (GitPullRequest35) unchanged. - Fix (query params / identifiers): OData
$-prefixed params ($top,$skip,$expand,$filter) and hyphenated params (api-version) now emit valid Dart identifiers (the$sigil is stripped from class/field names) while the ORIGINAL name is preserved as the wire key. Wire keys, JSON keys, and URL paths containing$are escaped for the Dart string literal so they no longer trigger string interpolation (which causedExpected an identifier/undefined_identifiererrors). - Fix (
ApiVersionphantom model): Swagger 2.0 shared parameters (#/parameters/api-Versionetc.) are now resolved against the top-levelparameterssection during normalization instead of being wrapped as a non-existentApiVersionschema — this was the dominant compile-error class on Azure DevOps specs. - Fix (HTTP Basic auth): Swagger 2.0
type: basicsecurity now generates a workingAuthorization: Basic <base64>interceptor (Azure DevOps PAT auth). The unknown-scheme fallback emits a self-contained no-op interceptor (previously referenced an undefined_NoopInterceptor). - New:
--workspaceflag.resolution: workspaceis now opt-in; the default generated package is standalone sodart pub getsucceeds without a pub-workspace root.
0.2.16 #
- Generated client descriptions lead with the covered surface and tags; the length cap goes from 120 to 180 characters.
0.2.15 #
- Generated pubspecs get a meaningful description when the spec has no
info.description: covered tags, pure-surface or not, and a do-not-hand-edit note.
0.2.14 #
- Generated client pubspecs declare
dio: ^5.11.1instead of a stale floor.
0.2.13 #
- New opt-in pure-surface mode (
--pure-surface,--core-package,--emit-target): transport-neutral clients over an injectedRequestAdapter. - Generated client pubspecs are workspace-ready with versioned dependencies; pure-surface clients declare
dioonly when they use it. - Generated code ignores
use_null_aware_elements, so fresh clients are lint-clean.
0.2.12 #
- Fix:
format: datefields now serialize to date-onlyyyyy-MM-dd(previously a full ISO datetime…T00:00:00.000), which a server binding a date-only type (e.g. .NETDateOnly) rejected with a 400. - Fix: arrays of
date/date-timenow serialize element-by-element intoJson(a rawList<DateTime>is not JSON-encodable →jsonEncodethrew at send time) and deserialize element-by-element infromJson(a bare.cast<DateTime>()over decoded strings threw at runtime).
0.2.11 #
- Fix: auth interceptors stamp the Authorization header only for a non-empty token (previously a bare
Bearerwas sent for an empty token). - Fix: enum fields in multipart form data serialize to their wire value (
.toJson()) instead ofEnumType.name.
0.2.10 #
- Rewrite README comparison table: replaced non-OpenAPI tools (retrofit, chopper, ferry) with real pub.dev competitors (swagger_dart_code_generator, swagger_parser, openapi_generator, space_gen, openapi_spec), verified by source code analysis
- Add "Standalone CLI" row to comparison table
- Update install instructions to ^0.2.10
0.2.9 #
- Bump dev dependencies:
lints^6.1.0,test^1.31.2 - Restore version constraints on all dependencies for pub.dev compliance
0.2.8 #
- Fix primitive list/map
fromJsondeserialization: emit(expr as List).cast<T>()and(expr as Map).cast<K, V>()instead of a directexpr as List<T>/as Map<K, V>cast. A decoded JSON array/object is alwaysList<dynamic>/Map<String, dynamic>at runtime, so the direct cast threwtype 'List<dynamic>' is not a subtype of type 'List<String>'— crashing deserialization of any model with a primitive array (e.g. a login responserolesfield, breaking authentication). Now consistent with the.cast<T>()already used intype_utils.dart.
0.2.7 #
- Fix barrel file generation: export ALL model classes, API service files, and result type files instead of only 5 hardcoded core exports
- Fix OpenAPI 3.1 nullable type array parsing:
["null","string"]format now correctly resolves to nullable string instead ofObject? - Add
_extractType()method to handle type arrays by extracting the first non-null type - Add nullable detection from type arrays in
_isSchemaNullable()for OAS 3.1 spec compatibility
0.2.6 #
- Add dartdoc from OpenAPI spec
descriptionfields on generated classes - Add dartdoc on
fromJsonfactory constructors - Fix union variant
toJsonreturn type (Map wrapper)
0.2.5 #
-
Auto-format generated code with
dart formatafter generation -
Fix
[]brackets in schema/parameter names (OAS 3.1 compatibility) -
Fix
String??double-nullable in generated method signatures -
Fix missing inline schema files (IrPrimitiveSchema, IrListSchema)
-
Fix inline enum/object extraction from nested schemas
-
Fix
List.generatestrict-cast: add(expr as List).lengthcast -
Fix
Response<dynamic>→Responseraw type warnings -
Fix
dio.request→dio.request<Map<String, dynamic>>type param -
Fix duplicate schema naming (Post400Response → Post400Response1)
-
Fix
requestBodywith empty schema generating invalid code -
Add dartdoc documentation to all public API (20%+ coverage)
-
Shorten pubspec description for pub.dev scoring
-
Add example/ directory with usage sample
0.2.3 #
- Update README with correct version references
0.2.2 #
- Generated pubspec uses pinned versions (dio: ^5.7.0, collection: ^1.19.0) instead of any
0.2.1 #
- Test fixtures included in repo for CI compatibility
- Fix test file paths for GitHub Actions
0.2.0 #
- Full OAS 3.1 YAML support (tested with train-travel OpenAPI)
- Swagger 2.0 support via SwaggerNormalizer (definitions → components/schemas, host+basePath → servers, body params → requestBody, securityDefinitions → securitySchemes)
- Inline schema extraction: inline objects, enums, oneOf items from properties, allOf items, array items
- Inline schema extraction at 3+ nesting levels with recursive extraction
- $ref resolution for extracted schemas added to _doc post-extraction
- Union model generator: variant classes at top level (not nested), variant naming without shadowing import names
- Empty models generate
const Foo();not invalidconst Foo({}); - Model imports use lowercase paths (macOS/Linux case-sensitivity)
- Remove redundant allOfRef imports from generated models
- Compute/Isolate mode: 0 issues on all 3 specs
- 36 tests: parser, model generation, API generation, full pipeline, Swagger 2.0, train-travel OAS 3.1, compute mode
- All generated clients compile with exit code 0 (0 errors, 0 warnings, 0 info)
- GitHub Actions CI + OIDC publish workflows
0.1.1 #
- Swagger 2.0 / OpenAPI 2.0 support via SwaggerNormalizer
- 2 Swagger 2.0 integration tests using official petstore.swagger.io spec
0.1.0 #
- Initial release
- OpenAPI 3.x JSON/YAML parser with full $ref resolution
- Immutable model generation: fromJson/toJson/copyWith/==/hashCode
- Dio-based API service generation with sealed exhaustive response types
- Typed auth generation (Bearer, ApiKey, OAuth2)
- Multipart/FormData support with MultipartFile.fromBytes
- Centralized error handling via ApiErrorInterceptor
- Pagination helpers (offset + cursor)
- --use-compute flag for Isolate.run JSON deserialization
- Parallel generation via Isolate.spawn
- Zero build_runner dependency in generated code