Skip to content

Commit

Permalink
feat(specs): Initial panos_ike_gateway codegen spec (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
kklimonda-cl authored Jan 14, 2025
1 parent 4993359 commit b0538d1
Show file tree
Hide file tree
Showing 3 changed files with 728 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/translate/assignments.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func finishNestedObjectIfBlock(parent []*properties.SpecParam, param *properties
}

func isParamName(param *properties.SpecParam) bool {
return param.Name.CamelCase == "Name"
return param.Required && param.Name.CamelCase == "Name"
}

func declareRootOfNestedObject(parent []*properties.SpecParam, builder *strings.Builder, version *version.Version, prefix, suffix string, isNestedListHack bool) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/translate/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func specMatchFunctionName(parent []string, param *properties.SpecParam) string
if param.Type == "list" && param.Items != nil && param.Items.Type == "string" {
return "util.OrderedListsMatch"
} else if param.Type == "string" {
if param.Name != nil && param.Name.CamelCase == "Name" {
if param.Name != nil && param.Required && param.Name.CamelCase == "Name" {
return "util.StringsEqual"
} else {
return "util.StringsMatch"
Expand Down
Loading

0 comments on commit b0538d1

Please sign in to comment.