Date-time in OpenAPI has problems when generating Java code

Hey folks!

I created a Java client using the OpenAPI.json and try to use this from a Java application towards Camunda Run 7.5.2-ee.

For convenience, I stripped the code down and pushed it here: GitHub - berndruecker/camunda-7-openapi-demo

I get an exception when I deploy a process definition (and it parses the response, respectively the date fields):

Exception in thread "main" org.threeten.bp.format.DateTimeParseException: Text '2021-06-09T16:36:24.807+0200' could not be parsed at index 23
	at org.threeten.bp.format.DateTimeFormatter.parseToBuilder(
	at org.threeten.bp.format.DateTimeFormatter.parse(
	at org.threeten.bp.OffsetDateTime.parse(
	at org.openapitools.client.JSON$
	at org.openapitools.client.JSON$
	at org.openapitools.client.JSON.deserialize(
	at org.openapitools.client.ApiClient.deserialize(
	at org.openapitools.client.ApiClient.handleResponse(
	at org.openapitools.client.ApiClient.execute(
	at org.openapitools.client.api.DeploymentApi.createDeploymentWithHttpInfo(
	at org.openapitools.client.api.DeploymentApi.createDeployment(
	at io.berndruecker.demo.App.main(

Seems the time zone offset “+0200” is not a valid “date-time” according to Data Types - but it is what Camunda Run returns for me. I deleted all

          "format": "date-time"

from the openapi.json and re-generated, then it works. It seems to be some additional format validation.

Is this a bug and should be fixed? It is a bit annoying as it does not work out to the box.

And as a bonus - the generated test case does not compile without manual fixes:



1 Like

@StephenOTT just pointed me to this list of possible issues with the current status of OpenAPI: OpenApi Bug Tracking (Camunda's OpenAPI Spec) · Issue #27 · StephenOTT/Cammand · GitHub

Hi @BerndRuecker,

Providing the answers, in case someone else has these problems:
for the openapi-generator-maven-plugin, the legacy property needs to be set in the configOptions. This solution is not Camunda Platform specific, it will vary based on the generator.

Regarding the failing test cases, CAM-13647 has been created.


Thanks Dan for adding this!

This is how that property looks like in real-life: Added legacy date library option · berndruecker/camunda-platform-openapi-demo@417dc6b · GitHub

Note that there was also oa bug with the "jobDefinitionID " that is fixed on master and the 7.15.3 EE patch level.