Netflix / Netflix/dgs-codegen

Reversed keywords should have prefix instead of throw error

Open
#246 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

For example

"""A profile for multi-location, per-product delivery."""
type DeliveryProfile implements Node {
  """A globally-unique identifier."""
  id: ID!

  """The name of the delivery profile."""
  name: String!

  """Whether this is the default profile."""
  default: Boolean!
}

Current behavior: Throw an exception because default is a reversed keyword.

Suggestion behavior: generate property with prefix and annotation @JsonProperty("default")

/**
 * A profile for multi-location, per-product delivery.
 */
@JsonTypeInfo(
    use = JsonTypeInfo.Id.NONE
)
public class DeliveryProfile implements com.example.types.Node {
  /**
   * A globally-unique identifier.
   */
  private String id;

  /**
   * The name of the delivery profile.
   */
  private String name;

  /**
   * Whether this is the default profile.
   */
  @JsonProperty("default")
  private boolean dgsDefault;
}

The prefix should be able to config

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

The issue names no source files, tests, or entry points. Start by locating the reversed-keyword validation and Java property generation, then trace existing keyword-handling tests; done means the shown GraphQL schema generates a prefixed Java property with @JsonProperty("default"), with a configurable prefix.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, java, kotlin
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.