swagger-api / swagger-api/swagger-codegen
[JAVA]referenced date time object is replaced by OffsetDateTime
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Custom DateTime definition defined in the open API definition is not handled and instead OffsetDateTime object is used.
Swagger-codegen version
latest from swagger editor ( http://editor.swagger.io/ )
Swagger declaration file content or url
https://app.swaggerhub.com/apis/myapi37/DateTimeBug/1
Command line used for generation
No, generated from swagger editor
Steps to reproduce
Use the provided open API definition and generate java client SDK for it.
Date Time model won't get generated and DateTimePayload contains list of OffsetDateTime instead of what is referenced in the definition (DateTime).
But if DateTime definition name is changed to DateTimeCommon, generated SDK contains DateTimeCommon model class and DateTimePayload class will have list of type DateTimeCommon class.
Looks like the problem is with the name "DateTime" in the below definition
"DateTime": {
"allOf": [
{
"$ref": "#/definitions/DateTimeCommonData"
},
{
"type": "object",
"properties": {}
}
]
}
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 with the SwaggerHub definition linked in the report and generate the Java client SDK from it. Compare the generated DateTimePayload and model classes with the DateTime and DateTimeCommonData definitions; done means the referenced DateTime model is generated and used instead of OffsetDateTime.
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
- 45/100