Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Similar classes get incorrectly deduplicated #425

Open
ark-1 opened this issue Mar 6, 2024 · 0 comments · May be fixed by #426
Open

Similar classes get incorrectly deduplicated #425

ark-1 opened this issue Mar 6, 2024 · 0 comments · May be fixed by #426

Comments

@ark-1
Copy link

ark-1 commented Mar 6, 2024

Steps to reproduce:
Input the following JSON:

{
  "firstTeam": {
    "hometown": {
      "name": "Town 1"
    },
    "stats": {
      "rating": 10
    }
  },
  "secondTeam": {
    "hometown": {
      "name": "Town 2"
    },
    "stats": {
      "rating": 20
    }
  }
}

Expected output:

data class Match(
    val firstTeam: FirstTeam,
    val secondTeam: SecondTeam
)

data class FirstTeam(
    val hometown: Hometown,
    val stats: Stats
)

data class SecondTeam(
    val hometown: Hometown,
    val stats: Stats
)

data class Hometown(
    val name: String
)

data class Stats(
    val rating: Int
)

Actual output:

data class Match(
    val firstTeam: FirstTeam,
    val secondTeam: SecondTeam
)

data class FirstTeam(
    val hometown: Hometown,
    val stats: Stats
)

data class SecondTeam(
    val hometown: Hometown,
    val stats: StatsX
)

data class Hometown(
    val name: String
)

data class Stats(
    val rating: Int
)

StatsX was not generated, but is referenced from SecondTeam.

ark-1 added a commit to ark-1/JsonToKotlinClass that referenced this issue Mar 6, 2024
@ark-1 ark-1 linked a pull request Mar 6, 2024 that will close this issue
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 a pull request may close this issue.

1 participant