Skip to content

Commit

Permalink
normalize example value in resource ID user specified segment to prev…
Browse files Browse the repository at this point in the history
…ent erroneous diffs (hashicorp#4465)
  • Loading branch information
stephybun authored and zaowang-ms committed Oct 22, 2024
1 parent 237c3e4 commit e166ac9
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ func (workaroundInconsistentlyDefinedSegments) Process(apiDefinition importerMod
val.Name = singularNameOfPrevious
if !strings.HasSuffix(val.Name, "Name") {
val.Name = fmt.Sprintf("%sName", singularNameOfPrevious)
// the parser sets the same value into Name and ExampleValue so this needs to be applied to ExampleValue as well
val.ExampleValue = fmt.Sprintf("%sName", singularNameOfPrevious)
}
}
}
Expand Down

0 comments on commit e166ac9

Please sign in to comment.