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

Auto validate JSONConverter objects #3885

Open
hamidonos opened this issue Feb 17, 2025 · 1 comment · May be fixed by #3938
Open

Auto validate JSONConverter objects #3885

hamidonos opened this issue Feb 17, 2025 · 1 comment · May be fixed by #3938
Labels
good first issue Good for newcomers

Comments

@hamidonos
Copy link
Collaborator

Situation

Currently there is no way to automatically let the JSONConverter validate deserialized objects.

You'd have to validate the objects manually after creation which is error-prone.

Wanted

The JSONConverter should automatically handle validation (similar to how Spring Bean Validation would work)

Solution

Idea:

Create a interface like JSONConvertable which defines a method called validate()

Inside the JSONConverter refactor the fromJson method so that It looks like this

`public T fromJSON(Class clazz, String json) ...

and call the validate() method automatically

@KYash03
Copy link

KYash03 commented Feb 18, 2025

PR: #3890

@KYash03 KYash03 linked a pull request Feb 26, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
2 participants