From 6b22eb61584010e47d59e740d460df0590bce871 Mon Sep 17 00:00:00 2001 From: Tom Ghyselinck <tom.ghyselinck@excentis.com> Date: Wed, 13 Mar 2019 21:06:12 +0100 Subject: [PATCH] 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)). --- .../languages/PythonAbstractConnexionServerCodegen.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java index 749091c02b1..8eb25bf89bd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java @@ -802,7 +802,8 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme if (operation.consumes != null ) { if (operation.consumes.size() == 1) { 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"); if ("multipart/form-data".equals(consume.get(MEDIA_TYPE))) { operation.isMultipart = Boolean.TRUE; -- GitLab