diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/MediaType.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/MediaType.java new file mode 100644 index 00000000..7850c603 --- /dev/null +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/MediaType.java @@ -0,0 +1,20 @@ +package io.redskap.swagger.brake.core.model; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.ToString; +import org.springframework.util.MimeType; +import org.springframework.util.MimeTypeUtils; + +@Getter +@EqualsAndHashCode +@ToString +public class MediaType { + public static final MediaType ALL = new MediaType("*/*"); + + private final MimeType mediaType; + + public MediaType(String mediaType) { + this.mediaType = MimeTypeUtils.parseMimeType(mediaType); + } +} diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/Request.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/Request.java index f9473984..13b7d419 100644 --- a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/Request.java +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/Request.java @@ -2,6 +2,7 @@ import java.util.Map; import java.util.Optional; +import java.util.Set; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -13,9 +14,17 @@ @EqualsAndHashCode @ToString public class Request { - private final Map mediaTypes; + private final Map mediaTypes; - public Optional getSchemaByMediaType(String mediaType) { + public Optional getSchemaByMediaType(MediaType mediaType) { return Optional.ofNullable(mediaTypes.get(mediaType)); } + + public boolean isMediaTypeAllowed(MediaType mediaType) { + Set availableMediaTypes = mediaTypes.keySet(); + if (availableMediaTypes.contains(MediaType.ALL)) { + return true; + } + return availableMediaTypes.contains(mediaType); + } } diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/Response.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/Response.java index b5c31b45..54e86b6f 100644 --- a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/Response.java +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/Response.java @@ -2,6 +2,7 @@ import java.util.Map; import java.util.Optional; +import java.util.Set; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -14,9 +15,17 @@ @ToString public class Response { private final String code; - private final Map mediaTypes; + private final Map mediaTypes; - public Optional getSchemaByMediaType(String mediaType) { + public Optional getSchemaByMediaType(MediaType mediaType) { return Optional.ofNullable(mediaTypes.get(mediaType)); } + + public boolean isMediaTypeAllowed(MediaType mediaType) { + Set availableMediaTypes = mediaTypes.keySet(); + if (availableMediaTypes.contains(MediaType.ALL)) { + return true; + } + return availableMediaTypes.contains(mediaType); + } } diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/transformer/ApiResponseTransformer.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/transformer/ApiResponseTransformer.java index f544599e..a03a4a15 100644 --- a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/transformer/ApiResponseTransformer.java +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/transformer/ApiResponseTransformer.java @@ -6,10 +6,10 @@ import java.util.Map; import java.util.Set; +import io.redskap.swagger.brake.core.model.MediaType; import io.redskap.swagger.brake.core.model.Response; import io.redskap.swagger.brake.core.model.Schema; import io.swagger.v3.oas.models.media.Content; -import io.swagger.v3.oas.models.media.MediaType; import io.swagger.v3.oas.models.responses.ApiResponse; import lombok.RequiredArgsConstructor; import org.apache.commons.lang3.tuple.Pair; @@ -22,11 +22,11 @@ public class ApiResponseTransformer implements Transformer from) { - Map schemaRefs = emptyMap(); + Map schemaRefs = emptyMap(); Content content = from.getValue().getContent(); if (content != null) { - Set> entries = content.entrySet(); - schemaRefs = entries.stream().collect(toMap(Map.Entry::getKey, e -> mediaTypeTransformer.transform(e.getValue()))); + Set> entries = content.entrySet(); + schemaRefs = entries.stream().collect(toMap(e -> new MediaType(e.getKey()), e -> mediaTypeTransformer.transform(e.getValue()))); } return new Response(from.getKey(), schemaRefs); } diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/transformer/RequestBodyTransformer.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/transformer/RequestBodyTransformer.java index 04efd289..e74f84f1 100644 --- a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/transformer/RequestBodyTransformer.java +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/model/transformer/RequestBodyTransformer.java @@ -5,9 +5,9 @@ import java.util.Map; import java.util.Set; +import io.redskap.swagger.brake.core.model.MediaType; import io.redskap.swagger.brake.core.model.Request; import io.redskap.swagger.brake.core.model.Schema; -import io.swagger.v3.oas.models.media.MediaType; import io.swagger.v3.oas.models.parameters.RequestBody; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -19,8 +19,8 @@ public class RequestBodyTransformer implements Transformer @Override public Request transform(RequestBody from) { - Set> entries = from.getContent().entrySet(); - Map mediaTypes = entries.stream().collect(toMap(Map.Entry::getKey, e -> mediaTypeTransformer.transform(e.getValue()))); + Set> entries = from.getContent().entrySet(); + Map mediaTypes = entries.stream().collect(toMap(e -> new MediaType(e.getKey()), e -> mediaTypeTransformer.transform(e.getValue()))); return new Request(mediaTypes); } } diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestMediaTypeDeletedBreakingChange.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestMediaTypeDeletedBreakingChange.java index 59303d4e..55fe5728 100644 --- a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestMediaTypeDeletedBreakingChange.java +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestMediaTypeDeletedBreakingChange.java @@ -4,6 +4,7 @@ import io.redskap.swagger.brake.core.BreakingChange; import io.redskap.swagger.brake.core.model.HttpMethod; +import io.redskap.swagger.brake.core.model.MediaType; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.RequiredArgsConstructor; @@ -16,7 +17,7 @@ public class RequestMediaTypeDeletedBreakingChange implements BreakingChange { private final String path; private final HttpMethod method; - private final String mediaType; + private final MediaType mediaType; @Override public String getMessage() { diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestMediaTypeDeletedRule.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestMediaTypeDeletedRule.java index 732ef3c9..6df296dc 100644 --- a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestMediaTypeDeletedRule.java +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestMediaTypeDeletedRule.java @@ -2,10 +2,7 @@ import java.util.*; -import io.redskap.swagger.brake.core.model.Path; -import io.redskap.swagger.brake.core.model.Request; -import io.redskap.swagger.brake.core.model.Schema; -import io.redskap.swagger.brake.core.model.Specification; +import io.redskap.swagger.brake.core.model.*; import io.redskap.swagger.brake.core.rule.BreakingChangeRule; import org.springframework.stereotype.Component; @@ -21,15 +18,21 @@ public Collection checkRule(Specification Optional requestBody = path.getRequestBody(); Optional newRequestBody = newPath.getRequestBody(); if (requestBody.isPresent() && newRequestBody.isPresent()) { - for (Map.Entry entry : requestBody.get().getMediaTypes().entrySet()) { - String mediaType = entry.getKey(); - if (!newRequestBody.get().getMediaTypes().containsKey(mediaType)) { - breakingChanges.add(new RequestMediaTypeDeletedBreakingChange(path.getPath(), path.getMethod(), mediaType)); - } - } + Request request = requestBody.get(); + Request newRequest = newRequestBody.get(); + checkMediaTypeBreaking(breakingChanges, path, request, newRequest); } } } return breakingChanges; } + + private void checkMediaTypeBreaking(Set breakingChanges, Path path, Request request, Request newRequest) { + for (Map.Entry entry : request.getMediaTypes().entrySet()) { + MediaType mediaType = entry.getKey(); + if (!newRequest.isMediaTypeAllowed(mediaType)) { + breakingChanges.add(new RequestMediaTypeDeletedBreakingChange(path.getPath(), path.getMethod(), mediaType)); + } + } + } } diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestTypeAttributeRemovedRule.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestTypeAttributeRemovedRule.java index 01007b37..2aaa9678 100644 --- a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestTypeAttributeRemovedRule.java +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestTypeAttributeRemovedRule.java @@ -2,10 +2,7 @@ import java.util.*; -import io.redskap.swagger.brake.core.model.Path; -import io.redskap.swagger.brake.core.model.Request; -import io.redskap.swagger.brake.core.model.Schema; -import io.redskap.swagger.brake.core.model.Specification; +import io.redskap.swagger.brake.core.model.*; import io.redskap.swagger.brake.core.rule.BreakingChangeRule; import org.springframework.stereotype.Component; @@ -21,8 +18,8 @@ public Collection checkRule(Specifica Optional requestBody = path.getRequestBody(); Optional newRequestBody = newPath.getRequestBody(); if (requestBody.isPresent() && newRequestBody.isPresent()) { - for (Map.Entry entry : requestBody.get().getMediaTypes().entrySet()) { - String mediaType = entry.getKey(); + for (Map.Entry entry : requestBody.get().getMediaTypes().entrySet()) { + MediaType mediaType = entry.getKey(); Schema schema = entry.getValue(); Optional newApiSchema = newRequestBody.get().getSchemaByMediaType(mediaType); if (newApiSchema.isPresent()) { diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestTypeEnumValueDeletedRule.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestTypeEnumValueDeletedRule.java index 43529dc4..97b3151b 100644 --- a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestTypeEnumValueDeletedRule.java +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/request/RequestTypeEnumValueDeletedRule.java @@ -2,10 +2,7 @@ import java.util.*; -import io.redskap.swagger.brake.core.model.Path; -import io.redskap.swagger.brake.core.model.Request; -import io.redskap.swagger.brake.core.model.Schema; -import io.redskap.swagger.brake.core.model.Specification; +import io.redskap.swagger.brake.core.model.*; import io.redskap.swagger.brake.core.rule.BreakingChangeRule; import org.springframework.stereotype.Component; @@ -21,8 +18,8 @@ public Collection checkRule(Specifica Optional requestBody = path.getRequestBody(); Optional newRequestBody = newPath.getRequestBody(); if (requestBody.isPresent() && newRequestBody.isPresent()) { - for (Map.Entry entry : requestBody.get().getMediaTypes().entrySet()) { - String mediaType = entry.getKey(); + for (Map.Entry entry : requestBody.get().getMediaTypes().entrySet()) { + MediaType mediaType = entry.getKey(); Schema schema = entry.getValue(); Optional newApiSchema = newRequestBody.get().getSchemaByMediaType(mediaType); if (newApiSchema.isPresent()) { diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseMediaTypeDeletedBreakingChange.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseMediaTypeDeletedBreakingChange.java index 738f76f0..cd5229d9 100644 --- a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseMediaTypeDeletedBreakingChange.java +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseMediaTypeDeletedBreakingChange.java @@ -4,6 +4,7 @@ import io.redskap.swagger.brake.core.BreakingChange; import io.redskap.swagger.brake.core.model.HttpMethod; +import io.redskap.swagger.brake.core.model.MediaType; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.RequiredArgsConstructor; @@ -16,7 +17,7 @@ public class ResponseMediaTypeDeletedBreakingChange implements BreakingChange { private final String path; private final HttpMethod method; - private final String mediaType; + private final MediaType mediaType; @Override public String getMessage() { diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseMediaTypeDeletedRule.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseMediaTypeDeletedRule.java index 34db9407..be6823bf 100644 --- a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseMediaTypeDeletedRule.java +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseMediaTypeDeletedRule.java @@ -2,10 +2,7 @@ import java.util.*; -import io.redskap.swagger.brake.core.model.Path; -import io.redskap.swagger.brake.core.model.Response; -import io.redskap.swagger.brake.core.model.Schema; -import io.redskap.swagger.brake.core.model.Specification; +import io.redskap.swagger.brake.core.model.*; import io.redskap.swagger.brake.core.rule.BreakingChangeRule; import org.springframework.stereotype.Component; @@ -22,16 +19,20 @@ public Collection checkRule(Specificatio Optional newApiResponse = newPath.getResponseByCode(apiResponse.getCode()); if (newApiResponse.isPresent()) { Response newResponse = newApiResponse.get(); - for (Map.Entry entry : apiResponse.getMediaTypes().entrySet()) { - String mediaType = entry.getKey(); - if (!newResponse.getMediaTypes().containsKey(mediaType)) { - breakingChanges.add(new ResponseMediaTypeDeletedBreakingChange(path.getPath(), path.getMethod(), mediaType)); - } - } + checkMediaTypeBreaking(breakingChanges, path, apiResponse, newResponse); } } } } return breakingChanges; } + + private void checkMediaTypeBreaking(Set breakingChanges, Path path, Response apiResponse, Response newResponse) { + for (Map.Entry entry : apiResponse.getMediaTypes().entrySet()) { + MediaType mediaType = entry.getKey(); + if (!newResponse.isMediaTypeAllowed(mediaType)) { + breakingChanges.add(new ResponseMediaTypeDeletedBreakingChange(path.getPath(), path.getMethod(), mediaType)); + } + } + } } diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseTypeAttributeRemovedRule.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseTypeAttributeRemovedRule.java index 7e255cd7..3ffa6f2c 100644 --- a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseTypeAttributeRemovedRule.java +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseTypeAttributeRemovedRule.java @@ -2,10 +2,7 @@ import java.util.*; -import io.redskap.swagger.brake.core.model.Path; -import io.redskap.swagger.brake.core.model.Response; -import io.redskap.swagger.brake.core.model.Schema; -import io.redskap.swagger.brake.core.model.Specification; +import io.redskap.swagger.brake.core.model.*; import io.redskap.swagger.brake.core.rule.BreakingChangeRule; import org.springframework.stereotype.Component; @@ -22,8 +19,8 @@ public Collection checkRule(Specific Optional newApiResponse = newPath.getResponseByCode(apiResponse.getCode()); if (newApiResponse.isPresent()) { Response newResponse = newApiResponse.get(); - for (Map.Entry entry : apiResponse.getMediaTypes().entrySet()) { - String mediaType = entry.getKey(); + for (Map.Entry entry : apiResponse.getMediaTypes().entrySet()) { + MediaType mediaType = entry.getKey(); Schema schema = entry.getValue(); Optional newApiSchema = newResponse.getSchemaByMediaType(mediaType); if (newApiSchema.isPresent()) { diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseTypeChangedRule.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseTypeChangedRule.java index 8a58cb0e..7e9b3fc4 100644 --- a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseTypeChangedRule.java +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseTypeChangedRule.java @@ -2,10 +2,7 @@ import java.util.*; -import io.redskap.swagger.brake.core.model.Path; -import io.redskap.swagger.brake.core.model.Response; -import io.redskap.swagger.brake.core.model.Schema; -import io.redskap.swagger.brake.core.model.Specification; +import io.redskap.swagger.brake.core.model.*; import io.redskap.swagger.brake.core.rule.BreakingChangeRule; import org.springframework.stereotype.Component; @@ -22,8 +19,8 @@ public Collection checkRule(Specification old Optional newApiResponse = newPath.getResponseByCode(apiResponse.getCode()); if (newApiResponse.isPresent()) { Response newResponse = newApiResponse.get(); - for (Map.Entry entry : apiResponse.getMediaTypes().entrySet()) { - String mediaType = entry.getKey(); + for (Map.Entry entry : apiResponse.getMediaTypes().entrySet()) { + MediaType mediaType = entry.getKey(); Schema schema = entry.getValue(); Optional newApiSchema = newResponse.getSchemaByMediaType(mediaType); if (newApiSchema.isPresent()) { diff --git a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseTypeEnumValueDeletedRule.java b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseTypeEnumValueDeletedRule.java index dcba8e19..08f8e44a 100644 --- a/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseTypeEnumValueDeletedRule.java +++ b/swagger-brake/src/main/java/io/redskap/swagger/brake/core/rule/response/ResponseTypeEnumValueDeletedRule.java @@ -2,10 +2,7 @@ import java.util.*; -import io.redskap.swagger.brake.core.model.Path; -import io.redskap.swagger.brake.core.model.Response; -import io.redskap.swagger.brake.core.model.Schema; -import io.redskap.swagger.brake.core.model.Specification; +import io.redskap.swagger.brake.core.model.*; import io.redskap.swagger.brake.core.rule.BreakingChangeRule; import org.springframework.stereotype.Component; @@ -22,8 +19,8 @@ public Collection checkRule(Specific Optional newApiResponse = newPath.getResponseByCode(apiResponse.getCode()); if (newApiResponse.isPresent()) { Response newResponse = newApiResponse.get(); - for (Map.Entry entry : apiResponse.getMediaTypes().entrySet()) { - String mediaType = entry.getKey(); + for (Map.Entry entry : apiResponse.getMediaTypes().entrySet()) { + MediaType mediaType = entry.getKey(); Schema schema = entry.getValue(); Optional newApiSchema = newResponse.getSchemaByMediaType(mediaType); if (newApiSchema.isPresent()) { diff --git a/swagger-brake/src/test/java/io/redskap/swagger/brake/integration/request/RequestMediaTypeDeletedIntTest.java b/swagger-brake/src/test/java/io/redskap/swagger/brake/integration/request/RequestMediaTypeDeletedIntTest.java index efe65577..b3fed966 100644 --- a/swagger-brake/src/test/java/io/redskap/swagger/brake/integration/request/RequestMediaTypeDeletedIntTest.java +++ b/swagger-brake/src/test/java/io/redskap/swagger/brake/integration/request/RequestMediaTypeDeletedIntTest.java @@ -7,6 +7,7 @@ import io.redskap.swagger.brake.core.BreakingChange; import io.redskap.swagger.brake.core.model.HttpMethod; +import io.redskap.swagger.brake.core.model.MediaType; import io.redskap.swagger.brake.core.rule.request.RequestMediaTypeDeletedBreakingChange; import io.redskap.swagger.brake.integration.AbstractSwaggerBrakeIntTest; import org.junit.Test; @@ -20,7 +21,7 @@ public void testRequestMediaTypeDeletedWorksCorrectly() { // given String oldApiPath = "request/mediatypedeleted/petstore.yaml"; String newApiPath = "request/mediatypedeleted/petstore_v2.yaml"; - RequestMediaTypeDeletedBreakingChange bc = new RequestMediaTypeDeletedBreakingChange("/pet", HttpMethod.POST, "application/xml"); + RequestMediaTypeDeletedBreakingChange bc = new RequestMediaTypeDeletedBreakingChange("/pet", HttpMethod.POST, new MediaType("application/xml")); Collection expected = Collections.singleton(bc); // when Collection result = execute(oldApiPath, newApiPath); diff --git a/swagger-brake/src/test/java/io/redskap/swagger/brake/integration/response/ResponseMediaTypeDeletedIntTest.java b/swagger-brake/src/test/java/io/redskap/swagger/brake/integration/response/ResponseMediaTypeDeletedIntTest.java index 8acc0607..b3f88c54 100644 --- a/swagger-brake/src/test/java/io/redskap/swagger/brake/integration/response/ResponseMediaTypeDeletedIntTest.java +++ b/swagger-brake/src/test/java/io/redskap/swagger/brake/integration/response/ResponseMediaTypeDeletedIntTest.java @@ -7,6 +7,7 @@ import io.redskap.swagger.brake.core.BreakingChange; import io.redskap.swagger.brake.core.model.HttpMethod; +import io.redskap.swagger.brake.core.model.MediaType; import io.redskap.swagger.brake.core.rule.response.ResponseMediaTypeDeletedBreakingChange; import io.redskap.swagger.brake.integration.AbstractSwaggerBrakeIntTest; import org.junit.Test; @@ -20,7 +21,7 @@ public void testResponseMediaTypeDeletedWorksCorrectly() { // given String oldApiPath = "response/mediatypedeleted/petstore.yaml"; String newApiPath = "response/mediatypedeleted/petstore_v2.yaml"; - ResponseMediaTypeDeletedBreakingChange bc = new ResponseMediaTypeDeletedBreakingChange("/pet/findByStatus", HttpMethod.GET, "application/json"); + ResponseMediaTypeDeletedBreakingChange bc = new ResponseMediaTypeDeletedBreakingChange("/pet/findByStatus", HttpMethod.GET, new MediaType("application/json")); Collection expected = Collections.singleton(bc); // when Collection result = execute(oldApiPath, newApiPath); diff --git a/swagger-brake/src/test/resources/nobreakingchange/petstore_v2.yaml b/swagger-brake/src/test/resources/nobreakingchange/petstore_v2.yaml index b7aac1b3..7602516c 100644 --- a/swagger-brake/src/test/resources/nobreakingchange/petstore_v2.yaml +++ b/swagger-brake/src/test/resources/nobreakingchange/petstore_v2.yaml @@ -67,7 +67,7 @@ paths: operationId: "updatePet" consumes: - "application/json" - - "application/xml" + - "*/*" produces: - "application/xml" - "application/json" @@ -99,7 +99,7 @@ paths: description: "Multiple status values can be provided with comma separated strings" operationId: "findPetsByStatus" produces: - - "application/xml" + - "*/*" - "application/json" parameters: - name: "status"