GetValues generates enum names in a way to minimize global conflicts
()
| 215 | |
| 216 | // GetValues generates enum names in a way to minimize global conflicts |
| 217 | func (e *EnumDefinition) GetValues() map[string]string { |
| 218 | // in case there are no conflicts, it's safe to use the values as-is |
| 219 | if !e.PrefixTypeName { |
| 220 | return e.Schema.EnumValues |
| 221 | } |
| 222 | // If we do have conflicts, we will prefix the enum's typename to the values. |
| 223 | newValues := make(map[string]string, len(e.Schema.EnumValues)) |
| 224 | for k, v := range e.Schema.EnumValues { |
| 225 | newName := e.TypeName + UppercaseFirstCharacter(k) |
| 226 | newValues[newName] = v |
| 227 | } |
| 228 | return newValues |
| 229 | } |
| 230 | |
| 231 | type Constants struct { |
| 232 | // SecuritySchemeProviderNames holds all provider names for security schemes. |
no test coverage detected