Skip to content

Commit

Permalink
fix: More explicit names and descriptions for `annotationHandler.sync…
Browse files Browse the repository at this point in the history
…` method
  • Loading branch information
ilyakuz-db committed Dec 17, 2024
1 parent 3049184 commit 0037671
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bundle/internal/schema/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion bundle/internal/schema/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 0037671

Please sign in to comment.