-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fix duplicated classes in packages and duplicated properties in… (
#2053) feat: fix duplicated classes in packages and duplicated properties in constructors from interfaces (#2051) Co-authored-by: Samuel Vazquez <[email protected]>
- Loading branch information
1 parent
62252fa
commit ea053a8
Showing
9 changed files
with
182 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...lient-generator/src/test/data/generator/union_same_selections/UnionSameSelections.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
query UnionSameSelections { | ||
message1 { | ||
__typename | ||
... on ProductRatingLink { | ||
link { | ||
text | ||
} | ||
action { | ||
text | ||
} | ||
} | ||
... on EGDSPlainText { | ||
text | ||
} | ||
} | ||
message2 { | ||
__typename | ||
... on EGDSParagraph { | ||
text | ||
} | ||
... on EGDSPlainText { | ||
text | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...lin-client-generator/src/test/data/generator/union_same_selections/UnionSameSelections.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.expediagroup.graphql.generated | ||
|
||
import com.expediagroup.graphql.client.Generated | ||
import com.expediagroup.graphql.client.types.GraphQLClientRequest | ||
import com.expediagroup.graphql.generated.unionsameselections.ProductRatingSupportingMessage | ||
import com.expediagroup.graphql.generated.unionsameselections.ProductSupportingMessage | ||
import kotlin.String | ||
import kotlin.collections.List | ||
import kotlin.reflect.KClass | ||
|
||
public const val UNION_SAME_SELECTIONS: String = | ||
"query UnionSameSelections {\n message1 {\n __typename\n ... on ProductRatingLink {\n link {\n text\n }\n action {\n text\n }\n }\n ... on EGDSPlainText {\n text\n }\n }\n message2 {\n __typename\n ... on EGDSParagraph {\n text\n }\n ... on EGDSPlainText {\n text\n }\n }\n}" | ||
|
||
@Generated | ||
public class UnionSameSelections : GraphQLClientRequest<UnionSameSelections.Result> { | ||
override val query: String = UNION_SAME_SELECTIONS | ||
|
||
override val operationName: String = "UnionSameSelections" | ||
|
||
override fun responseType(): KClass<UnionSameSelections.Result> = | ||
UnionSameSelections.Result::class | ||
|
||
@Generated | ||
public data class Result( | ||
public val message1: List<ProductRatingSupportingMessage>, | ||
public val message2: List<ProductSupportingMessage>, | ||
) | ||
} |
9 changes: 9 additions & 0 deletions
9
...ta/generator/union_same_selections/unionsameselections/EGDSProductRatingShowTextAction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.expediagroup.graphql.generated.unionsameselections | ||
|
||
import com.expediagroup.graphql.client.Generated | ||
import kotlin.String | ||
|
||
@Generated | ||
public data class EGDSProductRatingShowTextAction( | ||
public val text: String, | ||
) |
9 changes: 9 additions & 0 deletions
9
...tor/src/test/data/generator/union_same_selections/unionsameselections/EGDSStandardLink.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.expediagroup.graphql.generated.unionsameselections | ||
|
||
import com.expediagroup.graphql.client.Generated | ||
import kotlin.String | ||
|
||
@Generated | ||
public data class EGDSStandardLink( | ||
public val text: String, | ||
) |
39 changes: 39 additions & 0 deletions
39
...ata/generator/union_same_selections/unionsameselections/ProductRatingSupportingMessage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.expediagroup.graphql.generated.unionsameselections | ||
|
||
import com.expediagroup.graphql.client.Generated | ||
import com.fasterxml.jackson.`annotation`.JsonSubTypes | ||
import com.fasterxml.jackson.`annotation`.JsonTypeInfo | ||
import com.fasterxml.jackson.`annotation`.JsonTypeInfo.As.PROPERTY | ||
import com.fasterxml.jackson.`annotation`.JsonTypeInfo.Id.NAME | ||
import kotlin.String | ||
|
||
@Generated | ||
@JsonTypeInfo( | ||
use = JsonTypeInfo.Id.NAME, | ||
include = JsonTypeInfo.As.PROPERTY, | ||
property = "__typename", | ||
defaultImpl = DefaultProductRatingSupportingMessageImplementation::class, | ||
) | ||
@JsonSubTypes(value = [com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = | ||
ProductRatingLink::class, | ||
name="ProductRatingLink"),com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = | ||
EGDSPlainText::class, name="EGDSPlainText")]) | ||
public interface ProductRatingSupportingMessage | ||
|
||
@Generated | ||
public data class ProductRatingLink( | ||
public val link: EGDSStandardLink, | ||
public val action: EGDSProductRatingShowTextAction, | ||
) : ProductRatingSupportingMessage | ||
|
||
@Generated | ||
public data class EGDSPlainText( | ||
public val text: String, | ||
) : ProductRatingSupportingMessage, ProductSupportingMessage | ||
|
||
/** | ||
* Fallback ProductRatingSupportingMessage implementation that will be used when unknown/unhandled | ||
* type is encountered. | ||
*/ | ||
@Generated | ||
public class DefaultProductRatingSupportingMessageImplementation() : ProductRatingSupportingMessage |
33 changes: 33 additions & 0 deletions
33
...test/data/generator/union_same_selections/unionsameselections/ProductSupportingMessage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.expediagroup.graphql.generated.unionsameselections | ||
|
||
import com.expediagroup.graphql.client.Generated | ||
import com.fasterxml.jackson.`annotation`.JsonSubTypes | ||
import com.fasterxml.jackson.`annotation`.JsonTypeInfo | ||
import com.fasterxml.jackson.`annotation`.JsonTypeInfo.As.PROPERTY | ||
import com.fasterxml.jackson.`annotation`.JsonTypeInfo.Id.NAME | ||
import kotlin.String | ||
|
||
@Generated | ||
@JsonTypeInfo( | ||
use = JsonTypeInfo.Id.NAME, | ||
include = JsonTypeInfo.As.PROPERTY, | ||
property = "__typename", | ||
defaultImpl = DefaultProductSupportingMessageImplementation::class, | ||
) | ||
@JsonSubTypes(value = [com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = | ||
EGDSParagraph::class, | ||
name="EGDSParagraph"),com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = | ||
EGDSPlainText::class, name="EGDSPlainText")]) | ||
public interface ProductSupportingMessage | ||
|
||
@Generated | ||
public data class EGDSParagraph( | ||
public val text: String, | ||
) : ProductSupportingMessage | ||
|
||
/** | ||
* Fallback ProductSupportingMessage implementation that will be used when unknown/unhandled type is | ||
* encountered. | ||
*/ | ||
@Generated | ||
public class DefaultProductSupportingMessageImplementation() : ProductSupportingMessage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters