diff --git a/bundle/internal/schema/annotations.go b/bundle/internal/schema/annotations.go index 37572716b..aec5e68b0 100644 --- a/bundle/internal/schema/annotations.go +++ b/bundle/internal/schema/annotations.go @@ -109,8 +109,8 @@ func (d *annotationHandler) addAnnotations(typ reflect.Type, s jsonschema.Schema return s } -// Adds empty annotations with placeholders to the annotation file -func (d *annotationHandler) sync(outputPath string) error { +// Writes missing annotations with placeholder values back to the annotation file +func (d *annotationHandler) syncWithMissingAnnotations(outputPath string) error { existingFile, err := os.ReadFile(outputPath) if err != nil { return err diff --git a/bundle/internal/schema/main.go b/bundle/internal/schema/main.go index d6c7049a7..17730290f 100644 --- a/bundle/internal/schema/main.go +++ b/bundle/internal/schema/main.go @@ -163,7 +163,8 @@ func generateSchema(workdir, outputFile string) { log.Fatal(err) } - err = a.sync(annotationsPath) + // Overwrite the input annotation file, adding missing annotations + err = a.syncWithMissingAnnotations(annotationsPath) if err != nil { log.Fatal(err) }