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

Update GSON to 2.10.1 to support Record type #1314

Closed
BryanYin opened this issue Dec 27, 2022 · 1 comment
Closed

Update GSON to 2.10.1 to support Record type #1314

BryanYin opened this issue Dec 27, 2022 · 1 comment
Assignees
Labels
in: rest size: S state: won't fix This will not be worked on

Comments

@BryanYin
Copy link
Contributor

In a service, use Record as parameter type:

@Service("demo_testService")
public class TestService {
    public record TestRecord(String reader, Boolean isMain) {
    }

    public String testMethod(TestRecord reader) {
        return "Success";
    }
}

Install REST-API add-on, expose this method. Then, call this method, it will throw:

Caused by: java.lang.IllegalAccessException: Can not set final java.lang.String field com.tcx.coman.beans.services.TestService $TestRecord.reader to java.lang.String

After add implementation 'com.google.code.gson:gson:2.10' in build.gradle, the issue is gone. Please see also: google/gson#1794

Since Jmix supports JDK 17, we need this upgrade.

@gorbunkov gorbunkov changed the title update gson to 2.10 to support Record type Update GSON to 2.10.1 to support Record type Feb 8, 2023
@gorbunkov gorbunkov removed this from Release 2.0 Mar 2, 2023
@github-project-automation github-project-automation bot moved this to Backlog in Release 2.2 Jan 19, 2024
@gorbunkov gorbunkov moved this from Backlog to Next in Release 2.2 Feb 4, 2024
@gorbunkov gorbunkov self-assigned this Feb 5, 2024
@gorbunkov
Copy link
Contributor

The current Spring Boot already brings GSON 2.10.1. So the dependency is already delivered, no need to do anything special.

@gorbunkov gorbunkov closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2024
@github-project-automation github-project-automation bot moved this from Next to Done in Release 2.2 Feb 5, 2024
@gorbunkov gorbunkov added the state: won't fix This will not be worked on label Feb 5, 2024
@gorbunkov gorbunkov removed this from Release 2.2 Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: rest size: S state: won't fix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants