Skip to content

fix(scala3): legalize JSON property names#3080

Merged
schani merged 1 commit into
test/record-member-names-keywordsfrom
fix/scala3-keyword-identifiers
Jul 22, 2026
Merged

fix(scala3): legalize JSON property names#3080
schani merged 1 commit into
test/record-member-names-keywordsfrom
fix/scala3-keyword-identifiers

Conversation

@schani

@schani schani commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

  • generate legal, collision-free Scala identifiers for object properties instead of emitting raw JSON keys
  • preserve original wire names with Circe configured codecs and uPickle @key annotations
  • avoid inherited AnyRef/case-class member collisions such as clone and qualify generated runtime references that can be shadowed
  • enable all six Scala JSON fixtures previously skipped for identifier limitations in both Circe and uPickle

This PR is stacked on #3078 so its expanded keywords.json fixture directly covers the clone regression. It can be retargeted to master after #3078 merges.

keyword-unions.schema remains skipped for an unrelated JVM restriction: its generated case class exceeds the 254-parameter limit.

Tests

  • npm run build
  • npm run test:unit
  • npm run lint -- --no-errors-on-unmatched
  • full QUICKTEST=true FIXTURE=scala3,scala3-upickle npm run test:fixtures (98 tests; all runtime tests passed; a JSON-vs-schema source diff for recursive.json was fixed and reverified)
  • focused Circe/uPickle fixture runs for keywords.json, identifiers.json, simple-identifiers.json, blns-object.json, nst-test-suite.json, bug2521.json, and the C#: add --use-records option for C# 9+ record types #3071 record-member-names.json input

@schani
schani merged commit ec64d59 into test/record-member-names-keywords Jul 22, 2026
32 checks passed
@schani
schani deleted the fix/scala3-keyword-identifiers branch July 22, 2026 21:24
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.

1 participant