NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev
pub.dev, #1179 most downloaded on pub.dev
Generate Dart models and HTTP clients from Swagger and OpenAPI. Supports Retrofit, Dio, and package:http.
Latest stable
2.0.1
Last release 12 days ago
10 Nov 2026
Ships fairly regularly
a new release about every 4 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
155 releases · first in 2022
Drag across the ruler to compare, or tap a release to open it.
Fixes single-reference allOf properties with descriptions generating duplicate models and losing enum types (#479).
allOf properties with descriptions generating duplicate models
and losing enum types (#479).infer_missing_required to false. Set it to true to infer required
non-nullable fields without defaults when required is absent
(#482).first_success decoding declared bodyless success responses as payloads.
Buffered return types become nullable when a bodyless success is declared.
Handle null after regenerating affected clients
(#483).Rebuilds parsing in swagger_parser_core for Swagger 2.0 and OpenAPI 3.0–3.2.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
swagger_parser_core for Swagger 2.0 and OpenAPI 3.0–3.2.json_serializable, Freezed, and dart_mappable.package:http clients alongside Retrofit + Dio.swagger_parser_templates.
Use its package and CLI for custom output.Adds freezed_nullable_presence (default false ) to generate a <name>Present flag for each optional nullable property of Freezed models, so toJson can
freezed_nullable_presence (default false) to generate a <name>Present flagtoJson can tell an omittednull, for example to clear a field in a PATCH request bodyFixes OpenAPI 3 schemas without a required array generating every property as required when any property uses allOf ( #460 ).
required array generating every property as requiredallOfAdds freezed_json_serialization (default true ) to generate Freezed models without .g.dart and fromJson when JSON serialization is not needed. Existin
freezed_json_serialization (default true) to generate Freezed models.g.dart and fromJson when JSON serialization is not needed.Fixes infer_required_from_nullable treating OpenAPI 3.1 type lists containing "null" as non-nullable, which generated them as required T? ( #472 ).
infer_required_from_nullable treating OpenAPI 3.1 type lists containing "null"required T?Fixes schema filtering for component schemas referenced by endpoint parameters ( #470 ).
Fixes dart_mappable enum generation for JSON Schema type lists by quoting non-numeric JSON values ( #468 ).
dart_mappable enum generation for JSON Schema type lists by quotingAdd preserve_schema_casing option to preserve original casing of schema-derived identifiers, defaults to false for backwards compatibility, which norm
preserve_schema_casing option to preserve original casing of schema-derived identifiers, defaults to false for backwards compatibility, which normalises to PascalCasemultipart/form-data request body references a schema without propertiesallOf, oneOf, and anyOf schemas with sibling nullable: truepreserve_schema_casing option to preserve original casing of schema-derived identifiers,
defaults to false for backward compatibility, which normalises to PascalCase.multipart/form-data request body references a schema without properties.allOf, oneOf, and anyOf schemas with sibling
nullable: true.Fix escaping $unknown in generated enum toJson error messages
$unknown in generated enum toJson error messagesjson_serializabledart_mappable$unknown in generated enum toJson error messages.json_serializable.dart_mappable.Allow standard dart_mappable serializer method naming convention
dart_mappable serializer method names.Fix preserve property names and required modifiers in properties blocks
required modifiers in properties blocks.Add field_parsers option for setting field parsers for JSON serializable
field_parsers option for setting field parsers for JSON serializableAdd include_paths option for filtering endpoints by paths
include_paths option for filtering endpoints by pathsgenerate_urls_constants option for generating URL constants for all endpointsinclude_paths option for filtering endpoints by paths.generate_urls_constants option for generating URL constants for all endpoints.Fixes client methods returning ModelNameUnion instead of ModelNameSealed for oneOf types (#393).
ModelNameUnion instead of ModelNameSealed for oneOf types
(#393).Handle request body name generation case when request body is declared within request
Add replacement_rules_for_raw_schema option for raw schema objects replacement rules
replacement_rules_for_raw_schema option for raw schema objects replacement rulesFixes missing import for MultipartFile (#408).
MultipartFile (#408).components.responses.Add use_flutter_compute option for Flutter isolate-based multithreading support
use_flutter_compute option for Flutter isolate-based multithreading support
@RestApi(parser: Parser.FlutterCompute) annotation in Retrofit clientsswagger_parser:
use_flutter_compute: trueAdds add_openapi_metadata (default false) to generate OpenAPI tags, operationId, and externalDocsUrl constants for each endpoint; when extras_paramete
add_openapi_metadata (default false) to generate OpenAPI tags, operationId, and
externalDocsUrl constants for each endpoint; when extras_parameter_by_default is true, the
metadata is also prefilled into Dio extras—handy for interceptors and logging without
overwriting user-supplied extras.BannerApi.findAllBannersOpenapiExtras) so
generated implementations can access the static metadata constants.swagger_parser:
extras_parameter_by_default: true
add_openapi_metadata: true
abstract class PetsClient {
static const Map<String, dynamic> listPetsOpenapiExtras =
<String, dynamic>{
'openapi': <String, dynamic>{
'tags': <String>['pets'],
'operationId': 'listPets',
'externalDocsUrl': 'https://docs.example.com/pets',
},
};
@GET('/pets')
Future<void> listPets({
// defaults to the OpenAPI metadata; merge with your own extras if needed
@Extras() Map<String, dynamic>? extras =
PetsClient.listPetsOpenapiExtras,
@DioOptions() RequestOptions? options,
});
}
# https://openapi.sepc/pets/listPets
Fixes toString returning an int for enum names.
toString returning an int for enum names.* Fixes enum name generation.
Adds infer_required_from_nullable.
infer_required_from_nullable.infer_required_from_nullable: true
Schema without required array:
- id: type: integer → required int id
- name: type: string → required String name
- desc: type: string, nullable: true → String? desc
Adds includeIfNull handling, disabled by default; set include_if_null: true to enable it.
includeIfNull handling, disabled by default; set include_if_null: true to enable it.Fixes duplicate changelog entries.
Deprecates when and maybeWhen with @Deprecated() for dart_mappable. Use Dart pattern matching instead.
oneOf and anyOf with json_serializable and dart_mappable.
Uses O(n) try-catch decoding without a discriminator, where n is the number of variants.
Use a discriminator for O(1) dispatch. Supports fallback variants when decoding fails.dart_mappable_convenient_when for dart_mappable unions.
Generates when<T> and maybeWhen<T> when true.
Generates sealed classes when false (the default).when<T> and maybeWhen<T> with @Deprecated() for dart_mappable.
Use Dart pattern matching instead.unknown enum values with dart_mappable and unknown_enum_value: true.Fixes resolution of inline schemas in tagged operations.
Adds support for merging all generated code into single output file using the merge_outputs option.
merge_outputs
option.Adds support for non-discriminated unions (oneOf/anyOf without a discriminator).
Adds support for non-discriminated unions (oneOf/anyOf without a discriminator).
Filters out unused schemas when using include_tags or exclude_tags.
Fixes the client name for untagged paths to properly fall back to the configured fallback_client
instead of client.
Fixes the fallback_client configuration to default to fallback instead of default to avoid
conflicts with the Dart default keyword in the generated code.
Fixes OpenAPI spec parsing to correctly preserve casing for SCREAMING_SNAKE_CASE.
Fixes filtering so paths without tags are filtered out when include_tags is specified.
Fixes file names for tags with alphanumeric suffixes.
Allows filtering generated client endpoints by tags.
Fixes collisions between untagged endpoints and endpoints tagged Client that caused generated clients to overwrite each other.
Client that caused generated
clients to overwrite each other.Aligns default value handling for parameters according to the OpenAPI specification: https://swagger.io/docs/specification/v3_0/describing-parameters/
BREAKING CHANGE: Makes dart_mappable toJson return a string. Use the returned JSON string instead of a map.
toString override for dart_mappable.dart_mappable toJson return a string.
Use the returned JSON string instead of a map.Allows using MultipartFile instead of File in multipart requests, to support usage on web.
MultipartFile instead of File in multipart requests, to support usage on web.Adds an enum toString() override that provides a JSON value to third-party consumers such as Retrofit.
toString() override that provides a JSON value to third-party consumers such as
Retrofit.Adds the $valuesDefined getter to filter out unknown values automatically.
$valuesDefined getter to filter out unknown values automatically.Deduplicates property names for allOf schemas that mix ref and properties, preventing naming overlaps.
allOf schemas that mix ref and properties, preventing naming
overlaps.Fixes typedef imports when generating json_serializable classes; see google/json_serializable#1124.
typedef imports when generating json_serializable
classes; see
google/json_serializable#1124.Removes duplicate parameters in data classes (#322).
BREAKING CHANGE: Requires Dart 3.6 or later. Update the Dart SDK before upgrading.
Fixes error with client parameters with $ (#262).
$ (#262).Updates the dart_mappable template.
dart_mappable template.Adds support for allOf and other schema compositions (#239).
* Adds support for Freezed 3.
Adds support for oneOf polymorphic types with dart_mappable (#290).
oneOf polymorphic types with dart_mappable
(#290).Fixes errors with nullable in enums (#216).
Fixes errors with config (#293, #296).
Adds use_x_nullable parameter to config (#295).
Fixes config properties inheritance with multi-scheme URLs (#293).
Adds support for union types oneOf (#265, #286).
Fixes errors with config parsing.
Adds validation parameters to generated Freezed classes.
Fixes replacement rules for OpenAPI v2 (#266).
Fixes generation with anyOf, oneOf and allOf properties (#260).
anyOf, oneOf and allOf
properties (#260).Adds a version getter to the root client.
final version = RestClient.version;
dio_options_parameter_by_default.BREAKING CHANGE: Maps int64 to int instead of BigInt. Update callers to use int.
int64 to int instead of BigInt. Update callers to use int.* Adds support for int64 types.
int64 types.Fixes errors with nullable: false.
nullable: false.Handles empty enum value case (#238).
required_by_default. Remove it from config; behavior matches false.One column per quarter.