-
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…
… constructors from interfaces (#2051) ### 🔗 Related Issues #2050 --------- Co-authored-by: Samuel Vazquez <[email protected]>
- Loading branch information
1 parent
d3ad960
commit 2318398
Showing
9 changed files
with
196 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 | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...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,31 @@ | ||
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 com.fasterxml.jackson.`annotation`.JsonProperty | ||
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( | ||
@get:JsonProperty(value = "message1") | ||
public val message1: List<ProductRatingSupportingMessage>, | ||
@get:JsonProperty(value = "message2") | ||
public val message2: List<ProductSupportingMessage>, | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
...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,11 @@ | ||
package com.expediagroup.graphql.generated.unionsameselections | ||
|
||
import com.expediagroup.graphql.client.Generated | ||
import com.fasterxml.jackson.`annotation`.JsonProperty | ||
import kotlin.String | ||
|
||
@Generated | ||
public data class EGDSProductRatingShowTextAction( | ||
@get:JsonProperty(value = "text") | ||
public val text: String, | ||
) |
11 changes: 11 additions & 0 deletions
11
...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,11 @@ | ||
package com.expediagroup.graphql.generated.unionsameselections | ||
|
||
import com.expediagroup.graphql.client.Generated | ||
import com.fasterxml.jackson.`annotation`.JsonProperty | ||
import kotlin.String | ||
|
||
@Generated | ||
public data class EGDSStandardLink( | ||
@get:JsonProperty(value = "text") | ||
public val text: String, | ||
) |
44 changes: 44 additions & 0 deletions
44
...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,44 @@ | ||
package com.expediagroup.graphql.generated.unionsameselections | ||
|
||
import com.expediagroup.graphql.client.Generated | ||
import com.fasterxml.jackson.`annotation`.JsonProperty | ||
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( | ||
@get:JsonProperty(value = "link") | ||
public val link: EGDSStandardLink, | ||
@get:JsonProperty(value = "action") | ||
public val action: EGDSProductRatingShowTextAction, | ||
) : ProductRatingSupportingMessage | ||
|
||
@Generated | ||
public data class EGDSPlainText( | ||
@get:JsonProperty(value = "text") | ||
public val text: String, | ||
) : ProductRatingSupportingMessage, | ||
ProductSupportingMessage | ||
|
||
/** | ||
* Fallback ProductRatingSupportingMessage implementation that will be used when unknown/unhandled | ||
* type is encountered. | ||
*/ | ||
@Generated | ||
public class DefaultProductRatingSupportingMessageImplementation() : ProductRatingSupportingMessage |
35 changes: 35 additions & 0 deletions
35
...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,35 @@ | ||
package com.expediagroup.graphql.generated.unionsameselections | ||
|
||
import com.expediagroup.graphql.client.Generated | ||
import com.fasterxml.jackson.`annotation`.JsonProperty | ||
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( | ||
@get:JsonProperty(value = "text") | ||
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