Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/quicktype-core/src/language/Kotlin/KotlinRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ export class KotlinRenderer extends ConvenienceRenderer {

protected forbiddenForEnumCases(
_e: EnumType,
_enumName: Name,
enumName: Name,
): ForbiddenWordsInfo {
return { names: [], includeGlobalForbidden: true };
return { names: [enumName], includeGlobalForbidden: true };
}

protected forbiddenForUnionMembers(
Expand Down
1 change: 1 addition & 0 deletions test/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ const skipTypeScriptTests = [
"optional-union.json",
"pokedex.json", // Enums are screwed up: https://github.com/YousefED/typescript-json-schema/issues/186
"github-events.json",
"kotlin-enum-class-case-collision.json",
"bug855-short.json",
"bug863.json",
"00c36.json",
Expand Down
22 changes: 22 additions & 0 deletions test/inputs/json/priority/kotlin-enum-class-case-collision.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{ "category": " " },
{ "category": "" },
{ "category": " " },
{ "category": "" },
{ "category": " " },
{ "category": "" },
{ "category": " " },
{ "category": "" },
{ "category": " " },
{ "category": "" },
{ "category": " " },
{ "category": "" },
{ "category": " " },
{ "category": "" },
{ "category": " " },
{ "category": "" },
{ "category": " " },
{ "category": "" },
{ "category": " " },
{ "category": "" }
]
1 change: 1 addition & 0 deletions test/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,7 @@ export const KotlinXLanguage: Language = {
// Top-level arrays render as `typealias TopLevel = JsonArray<T>`,
// which doesn't compile — kotlinx's JsonArray takes no type
// arguments (documented TODO in KotlinXRenderer.ts).
"kotlin-enum-class-case-collision.json",
"bug863.json",
"github-events.json",
"optional-union.json",
Expand Down
Loading