[java] [webclient] allow ndjson (#13674)

* fix 13673. include ndjson into consideration when client selects accepted type

* update examples
This commit is contained in:
feech
2022-10-17 08:01:54 +01:00
committed by GitHub
parent dc23ba3a23
commit 53dc385fc6
3 changed files with 3 additions and 3 deletions

View File

@@ -488,7 +488,7 @@ public class ApiClient extends JavaTimeFormatter {
* @return boolean true if the MediaType represents JSON, false otherwise
*/
public boolean isJsonMime(MediaType mediaType) {
return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*\\+json[;]?\\s*$"));
return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$"));
}
/**