Netflix / Netflix/dgs-codegen

bug: Kotlin Codegen fails to generate Code when field name `package` is present

Open
#641 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Kotlin
Stars
217
Forks
116
PR merge metrics
No merged PRs in 30d

Description

Expected behavior

I was attempting to generate a client for the GitHub GraphQL API: https://docs.github.com/en/graphql/overview/public-schema

Unfortunately, it has a few fields name package and one type called Package thus causing an exception to get thrown when the code is generated

Actual behavior

Currently, the Gradle build fails with an error that package is an invalid name

Steps to reproduce

Note: A test case would be highly appreciated, but we understand that's not always possible

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the Gradle client generation with the GitHub GraphQL public schema, then locate Kotlin codegen handling for the package field and Package type. Done means generation completes successfully for that schema, with a regression test if the project’s test structure supports it.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.