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
Swagger generated code now silently ignores invalid values for enumerated types.
We used to have 400 exception which was perfect:
HTTP/1.1 400 Bad Request
X-Powered-By: Servlet/3.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, DELETE, PUT
Access-Control-Allow-Headers: Content-Type
Content-Length: 533
Content-Type: text/plain
Content-Language: en-AU
Connection: Close
Date: Thu, 03 Nov 2016 05:38:45 GMT
The supplied JSON was not well formed: Can not construct instance of.....
Swagger-codegen version
2.2.2-SNAPSHOT
Command line used for generation
Java, Jersey 2, jaxrs
Steps to reproduce
that code is the issue I think.
@JsonCreator
public static XXXEnum fromValue(String text) {
for (XXXEnum b : XXXEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
Suggest a Fix
I think this is a key functionality that cannot be changed. Several projects relying on that validation
Please revert the changes.
The text was updated successfully, but these errors were encountered:
@wing328, what do you think about just reverting that template back to the previous implementation without that code snapshot? our user stories relied on the 400 status code coming from the original implementation if the value was not in the enum set.
Description
Swagger generated code now silently ignores invalid values for enumerated types.
We used to have 400 exception which was perfect:
HTTP/1.1 400 Bad Request
X-Powered-By: Servlet/3.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, DELETE, PUT
Access-Control-Allow-Headers: Content-Type
Content-Length: 533
Content-Type: text/plain
Content-Language: en-AU
Connection: Close
Date: Thu, 03 Nov 2016 05:38:45 GMT
The supplied JSON was not well formed: Can not construct instance of.....
Swagger-codegen version
2.2.2-SNAPSHOT
Command line used for generation
Java, Jersey 2, jaxrs
Steps to reproduce
that code is the issue I think.
@JsonCreator
public static XXXEnum fromValue(String text) {
for (XXXEnum b : XXXEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
Suggest a Fix
I think this is a key functionality that cannot be changed. Several projects relying on that validation
Please revert the changes.
The text was updated successfully, but these errors were encountered: