tonik_generate 0.7.1 copy "tonik_generate: ^0.7.1" to clipboard
tonik_generate: ^0.7.1 copied to clipboard

A code generation package for Tonik.

0.7.1 #

  • REFACTOR: inline NameManager construction in test, drop test helper.
  • REFACTOR: simplify inline helper context, use _$ sigil for helper names.
  • REFACTOR: replace labelled break with extracted _processSegment method.
  • FIX: handle byte/binary cookie params instead of emitting toForm on TonikFile.
  • FIX: handle empty oneOf without producing invalid Dart.
  • FIX: drop dead _isFormBodyPureThrow parameter and tighten WHY comments.
  • FIX: extend pure-throw handling to nullable List
  • FIX: skip unused decode locals when response body decodes to a pure throw.
  • FIX: tighten dedup tests, doc accuracy, and decode helper context.
  • FIX: harden BuiltStatements safety pattern and recursion test coverage.
  • FIX: prevent stack overflow on self-referential map/list schemas.
  • FIX: add missing doc string for cookie parameters.
  • FIX: restore param-counter-collision endpoint and loop-based uniqueness fix.
  • FIX: reserve cancelToken in parameter name normalizer to prevent collision with built-in Dio parameter.
  • FIX: replace assert with throw StateError and hoist putIfAbsent in loop.
  • FIX: use loop in _ensureUniquenessInGroup to avoid counter collision.
  • FIX: close throw-class for all simple-encoded path parameter shapes.
  • FIX: hoist throw expressions for unsupported simple/matrix path params.
  • FIX: AnyModel encoding in tonik_util runtime and three generator callsites.
  • FIX: handle AnyModel and NeverModel as anyOf variants.
  • FIX: handle Base64Model variant in oneOf and anyOf encoding.
  • FIX: handle AliasModel in cookie parameter encoding.
  • FIX: handle AnyModel in cookie parameter encoding.
  • FIX: handle MapModel in cookie parameter encoding.
  • FIX: update stale comments referencing .lock to IList/IMap constructors.
  • FIX: pass useImmutableCollections to additionalPropertiesType in allOf fromJson.
  • FIX: pass useImmutableCollections to additionalPropertiesType in fromJson/fromSimple/fromForm.
  • FIX: use IList/IMap constructors via refer() instead of .lock extension for immutable collections.
  • FIX: use IList/IMap return types for direct collection response bodies with immutable collections.
  • FIX: reject complex list element types in label path parameter encoding.
  • FEAT: add integration tests and fix simple-style map/base64 encoding.
  • FEAT: add MapModel and Base64Model parameter encoding support.
  • DOCS: clarify nullability invariants in pure-throw helper comments.

0.7.0 #

  • REFACTOR: use specLiteralStringCode for trailing slash empty segment.
  • REFACTOR: move body collision logic into normalizeRequestParameters.
  • REFACTOR: add Model.resolved getter, remove alias-resolution duplication.
  • REFACTOR: use switch for encoding type exhaustiveness and fix edge cases.
  • FIX: remove dead model is! EnumModel check in OneOf generator.
  • FIX: handle MapModel correctly in multipart encoding.
  • FIX: escape keyword server variable names with $ prefix.
  • FIX: forward useQueryComponent in allOf/anyOf toForm and add UriEncodable to ClassModel.
  • FIX: distinguish user-defined Object from dart:core Object in copyWith cast.
  • FIX: sanitize naming collisions for keywords, Object members, and body params.
  • FIX: use wildcard pattern in throw-only switch arms to avoid unused variable lint.
  • FIX: use non-null-aware access for nullable headers inside null-check blocks.
  • FIX: use buildToJsonPropertyExpression for MapModel in allOf toJson.
  • FIX: include return _$formData in _buildMultipartFields for ClassModel.
  • FIX: use full method body comparison in form query parameter tests.
  • FIX: add null guards and empty-set checks in allOf encoding methods.
  • FIX: use null-safe calls for encoding methods on nullable types.
  • FIX: broken unit test.
  • FIX: use .resolved for all ListModel checks in allOf generator.
  • FIX: prevent parameterProperties calls on List and Map types in allOf.
  • FIX: use expression generator for additional properties toJson serialization.
  • FIX: resolve adjacent-string and prefer_single_quotes lint warnings in tests.
  • FIX: correct JSON decoding for List
  • FIX: resolve alias-to-primitive types in OneOf code generation.
  • FIX: remove self-references in writeOnly empty-properties paths.
  • FIX: emit targeted imports instead of barrel imports in generated code.
  • FIX: escape reserved enum member names and spell out numeric property names.
  • FIX: use flat Code additions instead of Block.of in switch expression.
  • FIX: replace all codegen-time throws with runtime throws in generated code.
  • FIX: generate runtime throw for ClassModel in list simple encoding.
  • FIX: handle AnyModel and NeverModel as oneOf variants.
  • FIX: keep literal suffixes in same path segment as parameters.
  • FIX: restore runtime entry.key context in URL-encoded error messages.
  • FIX: use raw string literals for spec-defined names in generated code.
  • FIX: handle triple-double-quote edge case in specLiteralString.
  • FIX: rewrite tests to follow testing conventions.
  • FIX: address PR review comments.
  • FIX: resolve lint violations from previous bug fix commits.
  • FIX: complete immutable collections support in all_of_generator.
  • FIX: address correctness and safety issues from comprehensive audit.
  • FIX: route \r values through escaped path to avoid literal CR in source.
  • FIX: update existing test to expect throw instead of silent skip.
  • FIX: handle newline characters in specLiteralStringCode.
  • FIX: better escape strings containing part 2.
  • FIX: better escape strings containing ‘ or “.
  • FIX: address PR review feedback.
  • FIX: preserve trailing slash in OpenAPI path segments.
  • FEAT: optionally generate code with fast_immutable_collections.
  • FEAT: add immutable collections integration tests and fix form/uri encoding.
  • FEAT: add request cancellation support via CancelToken.
  • FEAT: support for addtional properties.
  • DOCS: update specLiteralString docstring and add escape function tests.

0.6.0 #

  • FIX: validate version and use fallback.
  • FIX: prefix types with $ if they start with a number.
  • FIX: complex list handling in form and simple encoding.
  • FIX: impoved nullable checks in from json code generation.
  • FIX: proper scope dict definition.
  • FIX: proper nested nullable handling for models.
  • FIX: better nullable model handling.
  • FIX: improve doc formatting with multilines.
  • FIX: allow single ‘ and “ in properties and enum variables.
  • FIX: handle property names starting with plus (+) or minus (-).
  • FIX: better avoid shadowing via local variables.
  • FIX: proper handle required in multipart.
  • FIX: allow versions in enum values.
  • FIX: stable sort performance improvements.
  • FIX: graceful handle complex data in lists for matrix encoding.
  • FIX: llOf with nullable component models.
  • FIX: handle nullable json fields in classes.
  • FIX: add missing type annotation for matrix expressions.
  • FIX: handle binary data in parameters.
  • FIX: use raw strings for SimpleDecodingException.
  • FIX: improved binary and array without items handling.
  • FIX: fallback content type for multipart primitves.
  • FIX: correclty handle any models in multipart.
  • FIX: proper encoding for arrays in multipart.
  • FIX: better base64 data handleing.
  • FEAT: deep object support for multipart.
  • FEAT: better url encoding support mulitpart.
  • FEAT: improved array support in multipart.
  • FEAT: improve content type for mutlipart data with scalar types.
  • FEAT: use async file loading in multipart requests.
  • FEAT: introduce TonikFile.
  • FEAT: gracefully fail on mulitpart responses.
  • FEAT: multipart header support.
  • FEAT: basic form data handling.

0.5.0 #

  • FIX: proper default vlaue for explode in cookies.
  • FEAT: read and write only for any of.
  • FEAT: read and writ only for all of generator.
  • FEAT: read and write only for oneOf.
  • FEAT: handle schema level read and write only.
  • FEAT: further read/write only improvements.
  • FEAT: improve read/write only handling.
  • FEAT: support read and write only properties.
  • FEAT: allow more complex data in cookies.
  • FEAT: basic support for cookies.
  • FEAT: nested discriminator support (allOf).

0.4.1 #

  • FIX: remove escaping in raw string.
  • FIX: more defensive folder checks.
  • FIX: more folder existing checks.
  • FIX: improve folder exist tests.

0.4.0 #

  • FIX: ignroe warnings in generated code.
  • FIX: inline models with ref siblings where not generated in all cases.
  • FIX: don’t add trailing ? if there are no query parameters.
  • FIX: handle boolean schemas in lists correclty.
  • FIX: proper handling of lists with type arrays.
  • FIX: changelog link missing for tonik.
  • FEAT: server templating.
  • FEAT: improved encoding detection with OAS 3.1.
  • FEAT: support defs for OAS 3.1.
  • FEAT: ref sibling handling for 3.1.
  • FEAT: better support for boolean models.
  • FEAT: basic handling of boolean schemas.
  • FEAT: support mutualTLS for 3.1.
  • FEAT: better OAS 3 doc strings.
  • FEAT: support description overrides for 3.1.
  • FEAT: additional metadata fields for 3.1.

0.3.0 #

  • FIX: remove lints as dependency.
  • FEAT: better support for nullable schemas.

0.2.1 #

0.2.0 #

Note: This release has breaking changes.

  • FEAT: binary data type.
  • FEAT: improved response handling for text and binary.
  • FEAT: binary and text bodies in responses.
  • FEAT: improved copyWith allowing to set properties to null.
  • FEAT: various improvemts for configuration handling.
  • FEAT: custom content types via configuration.
  • FEAT: fallback cases for enums.
  • FEAT: config and name overrides.
  • BREAKING FEAT: require dart 3.10.0 or later.

0.1.0 #

  • REFACTOR: cleanup parameter generation.
  • REFACTOR: improve compile time checks for encoding of composite types in any of.
  • REFACTOR: matrix parameter.
  • REFACTOR: unified parameter encoding for classes.
  • FIX: list handling for allOf toJson.
  • FIX: update range checks for status codes.
  • FIX(parse_generator): add null assertion to status in range check.
  • FIX: toLabel list encoding.
  • FIX: form encoding.
  • FIX: various fixes for path parameter encodign.
  • FIX: stabilize names by sorting models.
  • FIX: lists in parameters with double encoding.
  • FIX: improved list handling for parameter encoding.
  • FIX: don’t double encode paths parameters.
  • FIX: check runtime encoding shape in classes.
  • FIX: anyOf currentEncodingShape wrongly reports mixed encoding.
  • FIX: nested oneOf parameter encodign.
  • FIX: simple encoding with invalid models and without bodies.
  • FEAT: allOf toMatrix.
  • FEAT: toMatrix for anyOf.
  • FEAT: improved list handing for matrix encoding.
  • FEAT: parameter properteis for anyOf.
  • FEAT: add allOf parameterEncoding.
  • FEAT: imporved matrix encoding for paths.
  • FEAT: parse deprecated fields for models.
  • FEAT: toMatrix for enums.
  • FEAT: matrix encoding for classes.
  • FEAT: more doc string generation.
  • FEAT: produce less runtime checks if composite models are not dynamic in encoding.
  • FEAT: anyOf and allOf toLabel.
  • FEAT: improved deep object query parameter encoding.
  • FEAT: toLabel for oneOf.
  • FEAT: add toLabel for classes.
  • FEAT: add toLabel for enums.
  • FEAT: annotate more entities with deprecated.
  • FEAT: parameter properteis for oneOf.

0.0.9 #

  • FEAT: form encoding and decoding for enums, classes, oneOf and composition types.
  • FEAT: discriminator support for oneOf simple encoding.
  • FEAT: improved simple encoding.
  • FEAT: security information in generated documentation.
  • FEAT: improved name generation.
  • FIX: oneOf handling and tests.
  • FIX: double encoded values for simple and form encoding.
  • FIX: runtime check for current encoding type.

0.0.8 #

  • REFACTOR: use simple encoding extension for request headers.
  • REFACTOR: remove usage of simple encoder for path parameters.
  • FIX: add missing simple properteis for one of classes.
  • FIX: path parameter encoding when only separated by a slash.
  • FIX: improved property json handling for one of models.
  • FEAT: toSimple for any of classes.
  • FEAT: simple properties for any of models.
  • FEAT: generate any of models.
  • FEAT: oneOf fromSimple / toSimple.
  • FEAT: to simple for classes.
  • FEAT: toSimple for enums.
  • FEAT: improved simple en- and decoding for all of models.
  • FEAT: fromSimple, toSimple for all of.
  • FEAT: property normailization for all of models.
  • FEAT: Uri property encoding and decoding.
  • FEAT: time zone aware encoding of date time objects.
  • FEAT: drop api prefix from generated server class.

0.0.6 #

  • FIX: proper handle dates.
  • FIX: priority for exlict defined names of schemas.
  • FIX: prio for explicitly defined names.
  • FIX: proper hash code for classes with >20 properties.

0.0.5 #

0.0.4 #

  • FEAT: generate all of classes.

0.0.3 #

  • FIX: honor paths in base urls.
  • FIX: improved handling for multi-line document descriptions.

0.0.2 #

  • REFACTOR: reorg folders.
  • REFACTOR: cleanup.
  • REFACTOR: cleanup code duplication.
  • REFACTOR: throw JsonDecodingException instead of ArgumentError.
  • REFACTOR: don’t create empty query params method.
  • REFACTOR: split tests, reduce code duplicaiton.
  • REFACTOR: extract hash code method generation.
  • REFACTOR: extract common equal method generation.
  • FIX: broken test assumption.
  • FIX: correct class names for multi content types response parsing.
  • FIX: handling of aliases in response parsing.
  • FIX: gneric type of response added.
  • FIX: proper handling in fromJson for nullable or non-required fields.
  • FIX: allow properties with names conflicting dart class methods.
  • FIX: options don’t need body if there is only a single body.
  • FIX: pass body to options method.
  • FIX: catch any thrown objects.
  • FIX: not-scoped typdef for alias request bodies.
  • FIX: broken test.
  • FIX: missing inline reponses.
  • FIX: reduce warnings in generated code.
  • FEAT: set accept headers.
  • FEAT: generate server class.
  • FEAT: fromSimple for classes.
  • FEAT: generate fromSimple factory for enums.
  • FEAT: improve response wrapper naming.
  • FEAT: equals and hash for response wrappers.
  • FEAT: doc strings for api clients.
  • FEAT: complex responses for response wrappers.
  • FEAT: response wrapper file writing.
  • FEAT: basic response wrapper generation.
  • FEAT: improved api client generation.
  • FEAT: handle classes with json or map properties names.
  • FEAT: provide request data.
  • FEAT: supply context when decoring headers.
  • FEAT: basic api client generation.
  • FEAT: improved name creation for multi-request bodies.
  • FEAT: content-type for requests.
  • FEAT: supply context when simple decoding models.
  • FEAT: add request body in core.
  • FEAT: body parameter for operations.
  • FEAT: allow context for decoding exceptions.
  • FEAT: do not generate dead code.
  • FEAT: improved response parsing.
  • FEAT: use server for api clients.
  • FEAT: sealed classes for multi-body responses.
  • FEAT: response parsing first part.
  • FEAT: add json decoding of more types to util.
  • FEAT: improved json decoding.
  • FEAT: improve verbosity for naming.
  • FEAT: response parsing in call method.
  • FEAT: response generator for single body responses.
  • FEAT: improved response name genreation.
  • FEAT: allow multiple bodies in responses.
  • FEAT: generate request body sealed classes.
  • FEAT: equals and hash code for one of classes.
  • FEAT: proper return types for call method of operations.
  • FEAT: improved request and response naming.
  • FEAT: support for response aliases.
  • FEAT: handle parameters for api clients.

0.0.1 #

  • Initial version.