gibahjoe / openapi-generator-dart

Openapi Generator for Dart/Flutter
BSD 3-Clause "New" or "Revised" License
112 stars 29 forks source link

Add updateAnnotatedFile property #139

Open aoisupersix opened 3 months ago

aoisupersix commented 3 months ago

Fixes #131

This PR adds updateAnnotatedFile property to @OpenApi() annotation.

When the timestamp is forcibly added or updated to the @OpenApi() annotated class, frequent differences occur in source control. Therefore, by adding the updateAnnotatedFile property, if false is set, the addition or update of the timestamp will not be performed.

@Openapi(
  ...
  updateAnnotatedFile: false,
)

Default is true to keep current behavior.

The operation was checked by uncommenting in openapi-generator/pubspec.yaml.

# dependency_overrides:
#  openapi_generator_annotations:
#    path: ../openapi-generator-annotations
Rick-VA commented 2 months ago

We tested it on 5 APIs, and it worked perfectly. Thanks