gibahjoe / openapi-generator-dart

Openapi Generator for Dart/Flutter
BSD 3-Clause "New" or "Revised" License
123 stars 34 forks source link

flutter 3.10.0 -> intl: 0.18.0 requirement #90

Closed raegtime closed 1 year ago

raegtime commented 1 year ago

Description of the bug

the generated pubspec for the api client has a intl 0.17.0 dependency

in flutter 3.10.0 intl has updated to min. version 0.18.0

Steps to reproduce

generate an api... look in the generated pubspec file

Expected behavior

intl version 0.18.0

Logs

No response

Screenshots

No response

Platform

macOS

Library version

4.10.0

Flutter version

3.10.0

Flutter channel

stable

Additional context

No response

danijel-tolj commented 1 year ago

You can use dependency overrides until the library dependencies are bumped to be up-to-date.

From documentation:

If you are having issues with dependencies, what you can do is make use of dependency overrides. This is added to the pubspec.yaml of the generated package and then the pubspec must be added to the .openapi-generator-ignore of the generated package. For example, let's assume you want to override the analyzer package for the generated source

in generatedsource/pubspec.yaml add the following

dependency_overrides:
    intl: 0.18.1

Then in generatedsources/.openapi-generator-ignore, add the below so that the pubspec is not overwritten next time you run source gen

thismatters commented 1 year ago

Is there going to be an update to the package to reflect this dependency change or is preventing generation of pubspec.yaml a permanent solution?

gibahjoe commented 1 year ago

@thismatters using dependency override is the recommended solution until the main library authors fixes the issue and releases an update.

I would be pushing an update later today so you can check if the issue is fixed there also. just in case.

gibahjoe commented 1 year ago

You can check the latest version if it fixes this issue as the openapi jar has been updated

bartekpacia commented 1 year ago

Unfortunately, this issue still occurs.

My app depends on intl: ^0.18.0, but the generated source has intl: '^0.17.0', thus making it incompatible.

ricardoboss commented 1 year ago

@bartekpacia I had the same issue. Are you adding intl below dependencies or as proposed above below dependency_overrides?

My working example looks like this:

dependencies:
    flutter
        sdk: flutter

    openapi_generator_annotations: ^4.11.0
    openapi:
        path: ./api

dependency_overrides:
    intl: 0.18.1