Skip to content

Commit ec815ca

Browse files
[Apex] better handling of different content-type in the response (#7515)
* PR7500 * update samples Co-authored-by: William Cheng <wing328hk@gmail.com>
1 parent 2c59f1d commit ec815ca

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

  • modules/openapi-generator/src/main/resources/apex
  • samples/client/petstore/apex/force-app/main/default/classes

modules/openapi-generator/src/main/resources/apex/OAS.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public class OAS {
183183

184184
@TestVisible
185185
protected virtual Object toReturnValue(String body, Type returnType, String contentType) {
186-
if (contentType == 'application/json') {
186+
if (contentType.contains('application/json')) {
187187
Object o = returnType.newInstance();
188188
if (o instanceof MappedProperties) {
189189
Map<String, String> propertyMappings = ((MappedProperties) o).getPropertyMappings();

samples/client/petstore/apex/force-app/main/default/classes/OAS.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public class OAS {
183183

184184
@TestVisible
185185
protected virtual Object toReturnValue(String body, Type returnType, String contentType) {
186-
if (contentType == 'application/json') {
186+
if (contentType.contains('application/json')) {
187187
Object o = returnType.newInstance();
188188
if (o instanceof MappedProperties) {
189189
Map<String, String> propertyMappings = ((MappedProperties) o).getPropertyMappings();

0 commit comments

Comments
 (0)