swagger-api / swagger-api/swagger-codegen
[JAVA] Client can't deserialize date-time
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I'm generating a Java client from my swagger definition created from my ASP .Net Core backend. When I call my Java client API to downloading a list of objects I get an exception as it fails to deserialize a field that is a date-time. This works for my generated TypeScript client but not for the Java client.
Downloaded data: https://gist.github.com/syeager/db93f1611ebd3b556a5e8ece76c60de4
Exception: https://gist.github.com/syeager/7436db72946dcf0baa2c7487faaed2e3
Swagger-codegen version
2.3.1
Swagger declaration file content or url
https://gist.github.com/syeager/e4ba6f52663d5f7d548db9bbf02a1785
Command line used for generation
java -jar swagger-codegen-cli.jar generate -i http://localhost:45455/swagger/v1/swagger.json --model-package Climb.Models --api-package Climb.API --invoker-package Climb -l android --library=volley -o .\tmp\
Steps to reproduce
Call my client API to download a list of objects with date-time as a field.
Related issues/PRs
Suggest a fix/enhancement
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
Start by reproducing the issue with the listed swagger-codegen command and Swagger declaration. Compare the downloaded data and exception from the linked gists with the generated Android/Volley client’s date-time handling. Done means the generated Java client can deserialize the date-time field when downloading the object list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100