You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my tests, I do not fill this QueryParam, and would therefore expect to get a response code 400 for this rest call.
However, I do get an 204er, indicating that:
the method was executed
and the param was null (null is mapped to status code 204)
This happens with resteasy classic, as well as with resteasy reactive.
I also tested this with BeanParams and with MultipartFormData. In both cases I explicitly left a field as null, but I never got a 400 response code.
@NotBlank in place of the @NotNull constraints works as expected - 400 is returned as status code, with a violation.
Expected behavior
NotNull should behave like NotBlank
For example, In case of NotBlank following violation is returned - I would expect similar for NotNull.
{
"title": "Constraint Violation",
"status": 400,
"violations": [
{
"field": "hello.arg0.text",
"message": "must not be blank"
}
]
}
Right now, no violation, and no 400 status code ist returned for @NotNull on QueryParam, BeanParam, and MultiPartForm, for resteasy classic and reactive.
Describe the bug
I have a resource defined like this:
In my tests, I do not fill this QueryParam, and would therefore expect to get a response code 400 for this rest call.
However, I do get an 204er, indicating that:
This happens with resteasy classic, as well as with resteasy reactive.
I also tested this with BeanParams and with MultipartFormData. In both cases I explicitly left a field as null, but I never got a 400 response code.
@NotBlank
in place of the@NotNull
constraints works as expected - 400 is returned as status code, with a violation.Expected behavior
NotNull
should behave likeNotBlank
For example, In case of NotBlank following violation is returned - I would expect similar for NotNull.
NotNull should work on rest resources, since it is used as an example in the spec. https://jakarta.ee/specifications/restful-ws/3.0/jakarta-restful-ws-spec-3.0.html#validation
Actual behavior
Right now, no violation, and no 400 status code ist returned for
@NotNull
on QueryParam, BeanParam, and MultiPartForm, for resteasy classic and reactive.To Reproduce
Steps to reproduce the behavior:
NotNull
constraint withNotBlank
Environment (please complete the following information):
Output of
uname -a
orver
Linux martin 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "15.0.1" 2020-10-20
OpenJDK Runtime Environment Zulu15.28+13-CA (build 15.0.1+8)
OpenJDK 64-Bit Server VM Zulu15.28+13-CA (build 15.0.1+8, mixed mode, sharing)
Quarkus version or git rev
1.13.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/martin/.sdkman/candidates/maven/current
Java version: 15.0.1, vendor: Azul Systems, Inc., runtime: /home/martin/.sdkman/candidates/java/15.0.1-zulu
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.8.0-48-generic", arch: "amd64", family: "unix"
The text was updated successfully, but these errors were encountered: