swagger-api / swagger-api/swagger-codegen
[Java] Map swagger "date" type to java.sql.Date
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Currently, both "date-time" and "date" are mapped to java.util.Date if the date library is not joda nor java8.
It would be better to map "date" to java.sql.Date which is a subclass of java.util.Date that represents a date without time.
This will allow to ser/deser "date" and "date-time" in distinct formats.
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 no files or tests. Start by locating the Java generator's mapping for Swagger "date" and "date-time" types, then inspect the generated serialization behavior. Done means "date" uses java.sql.Date while "date-time" remains java.util.Date when neither Joda nor Java 8 date libraries is selected, with coverage for both formats.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100