0

I am trying to generate interface from yaml file using open api generator plugin. However while generating the interface an additional annotation @DateTimeFormatter is getting added for date field. Can someone help how to skip adding this DateTimeFormatter annotation in date field.

Using 6.0.1 open api version

user3212324
  • 163
  • 1
  • 6
  • 23

1 Answers1

0

A possible (but quite heavy) solution would be to customize the mustache template that is used to generate such field (dateTimeParam.mustache)

https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/JavaSpring/dateTimeParam.mustache

You can configure Maven to use extra template(s) using:

<templateDirectory>${project.basedir}/openapi/templates</templateDirectory>

You can find an example here.

TacheDeChoco
  • 3,683
  • 1
  • 14
  • 17