swagger-api / swagger-api/swagger-codegen

<dateLibrary>java8</dateLibrary> is ignored

Open
#10,184 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

using

java8

has no effect at all. the code generated always uses org.threeten.bp.OffsetDateTime.

Swagger-codegen version

2.4.13

Command line used for generation

`


reference-data

						<goals>
							<goal>generate</goal>
						</goals>
						 
						 
						 <!-- <configHelp>true</configHelp>
						 https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen-maven-plugin
						  -->
						<configuration>
							<inputSpec>${project.basedir}/src/main/resources/swagger/reference-data-api-2020-04-16.yaml</inputSpec>
							<language>java</language>
			                <configOptions>
			                    <dateLibrary>java8</dateLibrary>
			                </configOptions>
							<generateApis>false</generateApis>
							
													
							<generateModels>true</generateModels>
							<modelPackage>com.eurocontrol.safire.migrationtool.rest.model.referencedata3</modelPackage>
							<generateModelTests>false</generateModelTests>
							<generateModelDocumentation>false</generateModelDocumentation>
							<generateSupportingFiles>false</generateSupportingFiles>
							
							<configOptions>
								<sourceFolder>src/gen/java/main</sourceFolder>
							</configOptions>
						</configuration>
					</execution>

`

No matter what I use and how many options from true I set inside , it always uses org.threeten.bp.OffsetDateTime.

is this option really working?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Maven plugin execution and input spec path shown in the issue, then trace how configOptions reaches the Java generator's dateLibrary setting. Done means the java8 option changes generated model date types instead of producing org.threeten.bp.OffsetDateTime; check for an existing generator test covering this configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.