Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[client] update Jackson client to always annotate input fields #1579

Merged
merged 2 commits into from
Oct 19, 2022

Conversation

dariuszkuc
Copy link
Collaborator

📝 Description

Update Jackson client generation logic to always annotate input 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.

Given a simple data class:

data class Foo(
  val isBoolean: Boolean = true,
  val isNotBoolean: String = "yes",
  val NOT: Boolean = true,
  val pID: Int = 1
)

It would be serialized as (before this change):

{
  "isBoolean" : true,
  "not" : true,
  "pid" : 1
}

After this change:

{
  "isBoolean" : true,
  "isNotBoolean" : "yes",
  "NOT" : true,
  "pID" : 1
}

🔗 Related Issues

Update Jackson client generation logic to always annotate input 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.

Given a simple data class:

```kotlin
data class Foo(
  val isBoolean: Boolean = true,
  val isNotBoolean: String = "yes",
  val NOT: Boolean = true,
  val pID: Int = 1
)
```

It would be serialized as (before this change):

```json
{
  "isBoolean" : true,
  "not" : true,
  "pid" : 1
}
```

After this change:

```json
{
  "isBoolean" : true,
  "isNotBoolean" : "yes",
  "NOT" : true,
  "pID" : 1
}
```

---

Resolves:

* ExpediaGroup#1486
* ExpediaGroup#1569
* ExpediaGroup#1578
@dariuszkuc dariuszkuc added changes: minor Changes require a minor version module: client Issue affects the client code labels Oct 19, 2022
@samuelAndalon samuelAndalon self-requested a review October 19, 2022 17:29
@samuelAndalon samuelAndalon merged commit 415a745 into ExpediaGroup:master Oct 19, 2022
@samuelAndalon samuelAndalon modified the milestone: 7.0.0 Oct 19, 2022
@myronmarston
Copy link

@dariuszkuc thanks for tackling this so quickly!

@dariuszkuc dariuszkuc deleted the jackson branch October 19, 2022 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes: minor Changes require a minor version module: client Issue affects the client code
3 participants