fix: More explicit names and descriptions for `annotationHandler.sync` method

This commit is contained in:
Ilya Kuznetsov 2024-12-17 15:04:19 +01:00
parent 304918436e
commit 00376711a3
2 changed files with 4 additions and 3 deletions

View File

@ -109,8 +109,8 @@ func (d *annotationHandler) addAnnotations(typ reflect.Type, s jsonschema.Schema
return s return s
} }
// Adds empty annotations with placeholders to the annotation file // Writes missing annotations with placeholder values back to the annotation file
func (d *annotationHandler) sync(outputPath string) error { func (d *annotationHandler) syncWithMissingAnnotations(outputPath string) error {
existingFile, err := os.ReadFile(outputPath) existingFile, err := os.ReadFile(outputPath)
if err != nil { if err != nil {
return err return err

View File

@ -163,7 +163,8 @@ func generateSchema(workdir, outputFile string) {
log.Fatal(err) log.Fatal(err)
} }
err = a.sync(annotationsPath) // Overwrite the input annotation file, adding missing annotations
err = a.syncWithMissingAnnotations(annotationsPath)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }