We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to use json-rpc with spring boot and I'm not able to validate model fields.
public class Payload { @NotNull(message = "amount is mandatory") private BigDecimal amount; @NotNull(message = "currency is mandatory") private String currency; // setter & getter & constructors ... } @JsonRpcService("/generate") public interface IGenerator { String generate(@Valid @JsonRpcParam(value = "payload") Payload payload); } @AutoJsonRpcServiceImpl @Component public class GeneratorImpl implements IGenerator { @Override public String generate(@Valid @JsonRpcParam(value = "payload") Payload payload) { return payload.getAmount() +" "+ payload.getCurrency(); } }
For that code I would expect if I didn't send amount or currency or both I would get ConstraintViolationException.
amount
currency
Is there any way to add validations on the model fields?
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
I'm trying to use json-rpc with spring boot and I'm not able to validate model fields.
For that code I would expect if I didn't send
amount
orcurrency
or both I would get ConstraintViolationException.Is there any way to add validations on the model fields?
The text was updated successfully, but these errors were encountered: