[Apex] better handling of different content-type in the response (#7515)

* PR7500

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
henryh-force
2020-09-27 09:10:14 -04:00
committed by GitHub
parent 2c59f1dc8c
commit ec815ca33a
2 changed files with 2 additions and 2 deletions

View File

@@ -183,7 +183,7 @@ public class OAS {
@TestVisible
protected virtual Object toReturnValue(String body, Type returnType, String contentType) {
if (contentType == 'application/json') {
if (contentType.contains('application/json')) {
Object o = returnType.newInstance();
if (o instanceof MappedProperties) {
Map<String, String> propertyMappings = ((MappedProperties) o).getPropertyMappings();

View File

@@ -183,7 +183,7 @@ public class OAS {
@TestVisible
protected virtual Object toReturnValue(String body, Type returnType, String contentType) {
if (contentType == 'application/json') {
if (contentType.contains('application/json')) {
Object o = returnType.newInstance();
if (o instanceof MappedProperties) {
Map<String, String> propertyMappings = ((MappedProperties) o).getPropertyMappings();