Skip to content

Commit e7bfa94

Browse files
committed
feat: updateAnnotatedFile property to OpenApi annotation
1 parent 2eab4ab commit e7bfa94

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

openapi-generator-annotations/lib/src/openapi_generator_annotations_base.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ class Openapi {
111111
/// Include in depth logging output from run commands.
112112
final bool debugLogging;
113113

114+
/// If set to true, the annotated file will be added or updated comment lines as of the last run date on the top of the file.
115+
/// Defaults to true
116+
final bool updateAnnotatedFile;
117+
114118
const Openapi({
115119
this.additionalProperties,
116120
this.skipSpecValidation = false,
@@ -129,6 +133,7 @@ class Openapi {
129133
this.cachePath,
130134
this.projectPubspecPath,
131135
this.debugLogging = false,
136+
this.updateAnnotatedFile = true,
132137
});
133138
}
134139

openapi-generator-annotations/test/openapi_generator_annotations_test.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ void main() {
5151
debugLogging: true);
5252
expect(api.debugLogging, isTrue);
5353
});
54+
test('Sets updateAnnotatedFile', () {
55+
final api = Openapi(
56+
inputSpec: InputSpec.json(),
57+
generatorName: Generator.dart,
58+
updateAnnotatedFile: false);
59+
expect(api.updateAnnotatedFile, isFalse);
60+
});
5461
group('InputSpec', () {
5562
group('local spec', () {
5663
test('provides default yaml path', () {

0 commit comments

Comments
 (0)