Commit 60879c5
authored
feat(client): update jackson client generation to always annotate all fields (#1976)
### 📝 Description
Update Jackson client generation logic to always annotate all fields
with @get:JsonProperty.
This is a workaround to Jackson limitations due to its reliance on
reflections to find getters/setters following JavaBean naming
conventions.
Simple mutation:
``` graphql
mutation CreateIssuedInvoice($input: IssuedInvoiceInput!) {
CreateIssuedInvoice(IssuedInvoice: $input) {
ID
Stav
CisloDokladu
}
}
```
Genarated before change:
```kotlin
public const val CREATE_ISSUED_INVOICE: String =
"mutation CreateIssuedInvoice(${'$'}input: IssuedInvoiceInput!) {\n CreateIssuedInvoice(IssuedInvoice: ${'$'}input) {\n ID\n Stav\n CisloDokladu\n }\n}"
@generated
public class CreateIssuedInvoice(
override val variables: CreateIssuedInvoice.Variables,
) : GraphQLClientRequest<CreateIssuedInvoice.Result> {
override val query: String = CREATE_ISSUED_INVOICE
override val operationName: String = "CreateIssuedInvoice"
override fun responseType(): KClass<CreateIssuedInvoice.Result> =
CreateIssuedInvoice.Result::class
@generated
public data class Variables(
@get:JsonProperty(value = "input")
public val input: IssuedInvoiceInput,
)
/**
* Dotazy pro zápis, editaci a mazání S5 objektů
*/
@generated
public data class Result(
/**
* Faktura vydaná (zápis)
*/
public val CreateIssuedInvoice: IssuedInvoice? = null,
)
}
```
Genareted after change:
```kotlin
public const val CREATE_ISSUED_INVOICE: String =
"mutation CreateIssuedInvoice(${'$'}input: IssuedInvoiceInput!) {\n CreateIssuedInvoice(IssuedInvoice: ${'$'}input) {\n ID\n Stav\n CisloDokladu\n }\n}"
@generated
public class CreateIssuedInvoice(
override val variables: CreateIssuedInvoice.Variables,
) : GraphQLClientRequest<CreateIssuedInvoice.Result> {
override val query: String = CREATE_ISSUED_INVOICE
override val operationName: String = "CreateIssuedInvoice"
override fun responseType(): KClass<CreateIssuedInvoice.Result> =
CreateIssuedInvoice.Result::class
@generated
public data class Variables(
@get:JsonProperty(value = "input")
public val input: IssuedInvoiceInput,
)
/**
* Dotazy pro zápis, editaci a mazání S5 objektů
*/
@generated
public data class Result(
/**
* Faktura vydaná (zápis)
*/
@get:JsonProperty("CreateIssuedInvoice")
public val CreateIssuedInvoice: IssuedInvoice? = null,
)
}
```
data class IssuedInvoice **before** change:
```kotlin
@generated
public data class IssuedInvoice(
/**
* ID
*/
@JsonSerialize(converter = UUIDToAnyConverter::class)
@JsonDeserialize(converter = AnyToUUIDConverter::class)
public val ID: UUID? = null,
/**
* Stav
*/
public val Stav: Int? = null,
/**
* Číslo dokladu
*/
public val CisloDokladu: String? = null,
)
```
data class IssuedInvoice **after** change:
```kotlin
@generated
public data class IssuedInvoice(
/**
* ID
*/
@JsonSerialize(converter = UUIDToAnyConverter::class)
@JsonDeserialize(converter = AnyToUUIDConverter::class)
@get:JsonProperty("ID")
public val ID: UUID? = null,
/**
* Stav
*/
@get:JsonProperty("Stav")
public val Stav: Int? = null,
/**
* Číslo dokladu
*/
@get:JsonProperty("CisloDokladu")
public val CisloDokladu: String? = null,
)
```
### 🔗 Related Issues
https://kotlinlang.slack.com/archives/CQLNT7B29/p17176557520841091 parent bce5bc4 commit 60879c5
File tree
85 files changed
+303
-0
lines changed- plugins/client/graphql-kotlin-client-generator/src
- main/kotlin/com/expediagroup/graphql/plugin/client/generator/types
- test/data
- generator
- alias_nested
- aliasnestedquery
- alias
- documentation
- documentationquery
- include_skip_directives
- includeskipdirectivesquery
- input_hard_coded
- input_lists
- input_self_reference
- interface_diff_selection_sets
- differentselectionsetquery
- interface_impl_diff_selection_sets
- differentselectionsetquery
- interface_missing_types
- interfacemissingtypeselection
- interface_named_fragments
- interfacewithnamedfragmentsquery
- mutation
- simplemutation
- object_diff_selection_set
- differentselectionsquery
- object_diff_sub_selection
- differentsubselectionquery
- object_list
- listquery
- object_named_fragments
- objectwithnamedfragmentquery
- object_self_reference
- nestedquery
- operation_name_missing
- anonymousquery
- operation_name_unchanged
- mixedcasequery
- reuse_list_types
- reusedlisttypesquery
- reuse_types
- reusedtypesquery
- scalar_typealias
- scalaraliasquery
- union_diff_selection_set2
- differentselectionsetquery
- union_diff_selection_set
- differentselectionsetquery
- union_missing_types
- unionmissingtypeselection
- union_named_fragments
- unionquerywithnamedfragments
- jackson
- custom_scalar_input
- custom_scalars
- customscalarquery
- enums
- interface
- interfacewithinlinefragmentsquery
- object
- complexobjectquery
- union
- unionquerywithinlinefragments
- variables
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
85 files changed
+303
-0
lines changedLines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
99 | 111 | | |
100 | 112 | | |
101 | 113 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
0 commit comments