Skip to content

Releases: dart-ogurets/dart-openapi-maven

6.1

16 Jul 20:15
Compare
Choose a tag to compare

This represents the migration to the 6.0.1+ line based on the OpenAPI generator libraries.

  • Moved to Java 11
  • Swap to Kotlin.
  • This is advertised as a breaking change in OpenAPI itself and has led to changes in the code to reflect that. Some classes changing their names, adding new classes which didn't exist before. This is
    a significant rewrite and retest of the functionality so we encourage people
    to report bugs and issues to us.
  • fields that are marked as required in the OpenAPI but have default values are not required in constructors (Dart fields with default values cannot be required)
  • previously required = non-null, !required = non-null. This behaviour
    has been refined. In Dart terms, it does not make sense for optional fields
    to not be nullable, so that remains, but required fields can now be
    nullable as long as they have a default value (or are a list or map).
  • required fields are now required - so if they aren't in the incoming JSON
    data we will throw a serialisation error. Optional fields if they are empty
    or null will not be sent (unless the generateNullValuesToJson additional
    property is used, in which case fields will always be be added).
  • numeric fields are no longer "cast", they are always converted to their
    respective variants, toInt() or toDouble() - down through lists and so forth.
  • arrays and maps which have the special provided default values are always
    const following Dart's requirements around constructors. This means you
    cannot "add" to them - i.e. create a model object and then add to the
    items in of the lists. If you wish to do this, you must provide a non-const
    value for the Map or List in the constructor.