swagger-api / swagger-api/swagger-codegen
[C#] How to mix DateTime and DateTimeOffset in a model?
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
My model contains properties of both types DateTime and DateTimeOffset. It is crucial for me to keep it that way. But unfortunately, as far as I understand, Swagger can only either generated all of them as DateTime (default behaviour) or as DateTimeOffset (with flag specified).
Is there a way to mix those?
Swagger-codegen version
v2.2.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names Swagger Codegen v2.2.1 but does not identify a file, template, test, or entry point. Start by locating the C# generation handling for DateTime and DateTimeOffset and determine whether type selection can vary per model property. Done would be support for a model containing both types, with coverage demonstrating the generated results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100