Carapacik / swagger_parser

Dart package that takes an OpenApi definition file and generates REST clients based on retrofit and data classes for your project.
https://pub.dev/packages/swagger_parser
MIT License
90 stars 38 forks source link

Add support for an another json serializer called `dart_mappable` #141

Closed dagyu closed 8 months ago

dagyu commented 9 months ago

With this issue I add the support for dart_mappable as json_serializer.

dart_mappable, is a library for json serialization and immutable data structures, it is like freezed but for our use case is by far better than it (I think in general but this is pretty subjective).

Edits


 - schema_path: schemas/openapi.json
    root_client_name: ApiMicroservice
-   freezed: true
+   jsonSerializer: "freezed"
    put_in_folder: true
    put_in_folder: true
    replacement_rules: []

Usage

The usage remains unchanged obviously if you want to use dart_mappable you need to:

Final considerations

Every changes has been made incremental without compromising and touching the other serializer in this way backward compatibility is totally granted. The only "breaking change" is the definition inside swagger_parser.yaml as explained above.

Please, I kindly request you to consider this PR and integrate it into the library. I am open to any suggestions or questions regarding my work.

Carapacik commented 9 months ago

Thanks for PR. Please fix analyze issues and add changelog to CHANGELOG.MD

dagyu commented 8 months ago

@Carapacik I do the followings:

dagyu commented 8 months ago

I fix the failing test