Mapping classes with conflicting naming in libraries fails

Aperta
#409 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java, kotlin
Ambito
tooling

Direzione di ricerca

Inizia riproducendo lo schema e i mapping con la generazione Java, in particolare Currency -> generated.Currency e Amount -> java.lang.Long. Traccia il percorso del mapping dei tipi e della risoluzione degli import nel generatore di codice; è completato quando l’Item generato include il mapping per generated.Currency senza richiedere che quella classe esista già.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

This issue seems to have been introduced after 5.1.9 somewhere.

I have a schema which roughly looks like this:

enum Currency {
  USD, EUR
}

type Item {
   amount: Amount
   currency: Currency
}

I have type mappings like this:
Currency -> generated.Currency
Amount -> java.lang.Long

What happens is that I do not get the type mapping as part of the import statement in the generated class. I am generating Java. The issue seems to be that the codegen actually wants to find the type it maps to, as it works if I change the mapping to an existing class.

Is this a bug or a feature? I see no reason why I shouldnt be able to use my generated classes as part of the type mapping which exists in the first place to avoid naming clashes.

Lingua principale
Kotlin
Stelle
220
Fork
123
Merge medio
1g 6h
PR unite (30g)
23

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Netflix/dgs-codegen

Tutte le issue di Netflix/dgs-codegen

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.