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

Add customizable number types in code generation #1650

Merged
merged 2 commits into from
Nov 28, 2023
Merged

Add customizable number types in code generation #1650

merged 2 commits into from
Nov 28, 2023

Conversation

yolofy
Copy link
Contributor

@yolofy yolofy commented Nov 27, 2023

This commit introduces an update enabling the customization of number types during code generation.

This is particularly useful for consuming financial APIs where the usage of double and float may lead to the accumulation of rounding errors.

It introduces settings to customize the .NET type of number, float, double, and decimal data types during code generation in 'CSharpGeneratorSettings.cs' and updates 'CSharpTypeResolver.cs' to use these settings.

This change allows better user control over how the number types get translated, making the code generation more versatile. Unit tests for different scenarios are included in the new 'NumberTests.cs'.

Also fixed the url in When_yaml_OpenAPI_spec_is__served_with_gzip_compression__it_works from

Jimmy added 2 commits November 27, 2023 12:22
This commit introduces an update enabling the customization of number types during code generation.

It introduces settings to customize the .NET type of number, float, double, and decimal data types during code generation in 'CSharpGeneratorSettings.cs' and updates 'CSharpTypeResolver.cs' to use these settings.

This change allows better user control over how the number types get translated, making the code generation more versatile. Unit tests for different scenarios are included in the new 'NumberTests.cs'.
@RicoSuter RicoSuter merged commit 5496a20 into RicoSuter:master Nov 28, 2023
2 checks passed
@RicoSuter
Copy link
Owner

thx for the PR.

@yolofy yolofy deleted the features/csharp_number_mapping_setting branch December 19, 2023 13:24
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