Skip to content

Commit 73d75c1

Browse files
nlundquistAlan-Cha
authored andcommitted
simple renaming also applies to schema values
Signed-off-by: Nils Lundquist <[email protected]>
1 parent 7ad15b8 commit 73d75c1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/openapi-to-graphql/src/schema_builder.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,14 @@ function createOrReuseEnum<TSource, TContext, TArgs>({
538538
const values = {}
539539
def.schema.enum.forEach((e) => {
540540
// Force enum values to string and value should be in ALL_CAPS
541-
values[Oas3Tools.sanitize(e.toString(), Oas3Tools.CaseStyle.ALL_CAPS)] = {
541+
values[
542+
Oas3Tools.sanitize(
543+
e.toString(),
544+
data.options.simpleNames
545+
? Oas3Tools.CaseStyle.simple
546+
: Oas3Tools.CaseStyle.ALL_CAPS
547+
)
548+
] = {
542549
value: e
543550
}
544551
})

0 commit comments

Comments
 (0)