Skip to content

support deserializing non public classes#4

Merged
Bnowako merged 1 commit intomasterfrom
deser-not-accessible-constructor
Oct 30, 2022
Merged

support deserializing non public classes#4
Bnowako merged 1 commit intomasterfrom
deser-not-accessible-constructor

Conversation

@Bnowako
Copy link
Copy Markdown
Owner

@Bnowako Bnowako commented Sep 21, 2022

Deser would throw
class mono.KlaksonDeser cannot access a member of class sample.Sample with modifiers ""
For classes that are not public e.g.

    public static User withAddress(String name, int age, String city, String street) {
        Address address1 = new Address(city, street);
        return new User(name, age, address1);
    }
}

record Address (String city, String street) {}

For Address class with default scope.
Solution for now will be to make constructor accessible. But we can think of some general rules for our DESER and maybe do not allow classes to be not public.

@Bnowako Bnowako requested a review from moscicky September 21, 2022 08:40
@Bnowako Bnowako merged commit 2e9ec1b into master Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant