Skip to content

Conversation

cnaples79
Copy link

@cnaples79 cnaples79 commented Sep 30, 2025

Summary

  • sanitize Kotlin identifier generation so schema fields like _ map to legal Kotlin members
  • propagate the sanitized names through Kotlin and Kotlin2 generators
  • add regression tests that compile underscore fields and check JsonProperty metadata

Rationale

  • fixes Kotlin compilation failures when GraphQL schemas expose members named _

Changes

  • add a shared Kotlin identifier sanitizer and update reserved keyword filtering to keep _
  • apply sanitized identifiers across Kotlin/Kotlin2 data, interface, constants, entity, and client generation
  • add regression tests for both generator paths covering underscore fields

Fixes #848

@cnaples79 cnaples79 force-pushed the fix-kotlin-underscore branch from 4be2a1a to f02de02 Compare September 30, 2025 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kotlin generator fails when '_' is used as a member

1 participant