forked from loafle/openapi-generator-original
* [#5172] Allow vendor json media types * Revert unnecessary diffs * Update petstore sample * Didn't run mvn after some edits * Rerun ' ./bin/java-petstore-all.sh' and './bin/security/java-petstore-okhttp-gson.sh' * Added more realistic test cases for isJsonMime
This commit is contained in:
@@ -458,11 +458,13 @@ public class ApiClient {
|
||||
* application/json
|
||||
* application/json; charset=UTF8
|
||||
* APPLICATION/JSON
|
||||
* application/vnd.company+json
|
||||
* @param mime MIME
|
||||
* @return True if MIME type is boolean
|
||||
*/
|
||||
public boolean isJsonMime(String mime) {
|
||||
return mime != null && mime.matches("(?i)application\\/json(;.*)?");
|
||||
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
|
||||
return mime != null && mime.matches(jsonMime);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -436,11 +436,13 @@ public class ApiClient {
|
||||
* application/json
|
||||
* application/json; charset=UTF8
|
||||
* APPLICATION/JSON
|
||||
* application/vnd.company+json
|
||||
* @param mime MIME
|
||||
* @return True if the MIME type is JSON
|
||||
*/
|
||||
public boolean isJsonMime(String mime) {
|
||||
return mime != null && mime.matches("(?i)application\\/json(;.*)?");
|
||||
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
|
||||
return mime != null && mime.matches(jsonMime);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -720,12 +720,13 @@ public class ApiClient {
|
||||
* application/json
|
||||
* application/json; charset=UTF8
|
||||
* APPLICATION/JSON
|
||||
*
|
||||
* application/vnd.company+json
|
||||
* @param mime MIME (Multipurpose Internet Mail Extensions)
|
||||
* @return True if the given MIME is JSON, false otherwise.
|
||||
*/
|
||||
public boolean isJsonMime(String mime) {
|
||||
return mime != null && mime.matches("(?i)application\\/json(;.*)?");
|
||||
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
|
||||
return mime != null && mime.matches(jsonMime);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user