Unit tests should not be skipped when MediaType defines its underlying structure as json (*/*+json, according to [RFC6838, section 4.2.8](https://tools.ietf.org/html/rfc6838#section-4.2.8)). (#2390)

This commit is contained in:
Tom Ghyselinck 2019-03-20 11:18:45 +01:00 committed by William Cheng
parent 218c2e75ab
commit 8bb01ed149

View File

@ -802,7 +802,8 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme
if (operation.consumes != null ) { if (operation.consumes != null ) {
if (operation.consumes.size() == 1) { if (operation.consumes.size() == 1) {
Map<String, String> consume = operation.consumes.get(0); Map<String, String> consume = operation.consumes.get(0);
if (! "application/json".equals(consume.get(MEDIA_TYPE))) { if (!("application/json".equals(consume.get(MEDIA_TYPE))
|| consume.get(MEDIA_TYPE).endsWith("+json"))) {
skipTests.put("reason", consume.get(MEDIA_TYPE) + " not supported by Connexion"); skipTests.put("reason", consume.get(MEDIA_TYPE) + " not supported by Connexion");
if ("multipart/form-data".equals(consume.get(MEDIA_TYPE))) { if ("multipart/form-data".equals(consume.get(MEDIA_TYPE))) {
operation.isMultipart = Boolean.TRUE; operation.isMultipart = Boolean.TRUE;