Fix date formatting for date-time types #600
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #599
With the changes in this pull request, the following OpenAPI document:
generates the following Refit interface:
This pull request includes changes to the
Refitter
project, focusing on improving date handling and updating test cases. The most important changes include modifying the date format handling inParameterExtractor.cs
, updating test cases to reflect these changes, and converting the OpenAPI specification format from JSON to YAML.Improvements to date handling:
src/Refitter.Core/ParameterExtractor.cs
: Modified the switch case to handleIsDate
separately fromIsDateOrDateTime
whenUseIsoDateFormat
is true.Updates to test cases:
src/Refitter.Tests/Examples/UseIsoDateFormatTests.cs
: Updated the OpenAPI specification format from JSON to YAML.src/Refitter.Tests/Examples/UseIsoDateFormatTests.cs
: Added new test cases to check for the presence and absence of specific date format strings in the generated code.src/Refitter.Tests/Examples/UseIsoDateFormatTests.cs
: Simplified theGenerateCode
method by combining settings initialization into a single line.src/Refitter.Tests/Examples/UseIsoDateFormatTests.cs
: Changed the file extension for the generated Swagger file from.json
to.yaml
.