Netflix / dgs-codegen

Apache License 2.0
182 stars 99 forks source link

Fix import of typemapped types in generated union classes. #657

Closed srinivasankavitha closed 7 months ago

srinivasankavitha commented 7 months ago

For generated union types, typemapped types are not imported properly.


            type A {
                name: String
            }

            type B {
                count: Int
            }

            union C = A | B

with config:

CodeGenConfig(
                schemas = setOf(schema),
                packageName = basePackageName,
                typeMapping = mapOf(
                    "A" to "java.lang.String"
                )
            )

Generated class for C does not have the proper import for A