Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: String format type mapping #766

Merged
merged 7 commits into from
Sep 18, 2024

Conversation

dan3988
Copy link
Contributor

@dan3988 dan3988 commented Sep 10, 2024

Adds the ability to specify custom types & a serialize/deserialize function for properties based on the "format" property.

Implementation of #719

      swagger_dart_code_generator:
        options:
          input_folder: "input_folder/"
          output_folder: "lib/swagger_generated_code/"
          import_paths:
            - "package:uuid/uuid.dart"
          scalars:
            uuid:
              type: Uuid
              deserialize: Uuid.parse
              # optional - default is toString()
              serialize: myCustomUuidSerializeFunction

@Vovanella95 Vovanella95 merged commit abb8575 into epam-cross-platform-lab:master Sep 18, 2024
1 check passed
AnnaKandel added a commit to arnac-io/swagger-dart-code-generator that referenced this pull request Oct 30, 2024
AnnaKandel pushed a commit to arnac-io/swagger-dart-code-generator that referenced this pull request Nov 3, 2024
* Allow string property types to be overridden based on the "format" schema property

* Added overridden_formats documentation & example to readme

* Removed whitespace

* Simplified tests for overridden format json converters

* Renamed overridden_formats property to scalars

* Updated readme URL for JSON schema format info

* Fixed arrays of scalar types not getting converter added to their property
AnnaKandel pushed a commit to arnac-io/swagger-dart-code-generator that referenced this pull request Nov 3, 2024
* Allow string property types to be overridden based on the "format" schema property

* Added overridden_formats documentation & example to readme

* Removed whitespace

* Simplified tests for overridden format json converters

* Renamed overridden_formats property to scalars

* Updated readme URL for JSON schema format info

* Fixed arrays of scalar types not getting converter added to their property
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants