Skip to content

Commit

Permalink
importer-msgraph-metadata: singularize constant names
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed Aug 14, 2024
1 parent 7f663b6 commit 3d03964
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/importer-msgraph-metadata/components/parser/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ func Schemas(input flattenedSchema, name string, models Models, constants Consta
if ((field.Type != nil && *field.Type == DataTypeString) || (field.ItemType != nil && *field.ItemType == DataTypeString)) && len(enum) > 0 {
// Despite being "fully qualified", type names are not unique in MS Graph, so we prefix them with the field name to provide some namespacing.
// This leads to some excessively long constant names, it is what it is.
field.ConstantName = pointer.To(name + field.Title)
field.ConstantName = pointer.To(normalize.Singularize(name + field.Title))

// Add the enumeration as a constant
constants[*field.ConstantName] = &Constant{
Expand Down

0 comments on commit 3d03964

Please sign in to comment.