Ticket #38583: 38583.2.diff
File 38583.2.diff, 26.8 KB (added by , 7 years ago) |
---|
-
src/wp-includes/rest-api.php
diff --git a/src/wp-includes/rest-api.php b/src/wp-includes/rest-api.php index 06bb9f9..df4c9bc 100644
a b function rest_get_avatar_sizes() { 1036 1036 * @return true|WP_Error 1037 1037 */ 1038 1038 function rest_validate_value_from_schema( $value, $args, $param = '' ) { 1039 1040 if ( $args === true ) { 1041 return true; 1042 } 1043 1044 if ( $args === false ) { 1045 return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not allowed.' ), $param ) ); 1046 } 1047 1048 if ( is_array( $args['type'] ) ) { 1049 $is_valid = false; 1050 1051 foreach ( $args['type'] as $type ) { 1052 $single_typed = $args; 1053 $single_typed['type'] = $type; 1054 1055 $is_valid = rest_validate_value_from_schema( $value, $single_typed, $param ); 1056 1057 if ( $is_valid === true ) { 1058 return true; 1059 } 1060 } 1061 1062 if ( false === $is_valid || is_wp_error( $is_valid ) ) { 1063 /* translators: %s: parameter, %l: list of types */ 1064 return new WP_Error( 'rest_invalid_param', wp_sprintf( __( '%s is not of type %l.' ), $param, $args['type'] ) ); 1065 } 1066 } 1067 1039 1068 if ( 'array' === $args['type'] ) { 1040 1069 if ( ! is_array( $value ) ) { 1041 1070 $value = preg_split( '/[\s,]+/', $value ); … … function rest_validate_value_from_schema( $value, $args, $param = '' ) { 1051 1080 } 1052 1081 } 1053 1082 } 1083 1084 if ( 'object' === $args['type'] ) { 1085 if ( ! is_array( $value ) ) { 1086 /* translators: 1: parameter, 2: type name */ 1087 return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'object' ) ); 1088 } 1089 1090 // How to validate properties that are not registered. 1091 $additional = isset( $args['additionalProperties'] ) ? $args['additionalProperties'] : true; 1092 1093 foreach ( $value as $property => $v ) { 1094 1095 $validate = isset( $args['properties'][ $property ] ) ? $args['properties'][ $property ] : $additional; 1096 $is_valid = rest_validate_value_from_schema( $v, $validate, $param . '[' . $property . ']' ); 1097 1098 if ( is_wp_error( $is_valid ) ) { 1099 return $is_valid; 1100 } 1101 } 1102 } 1103 1054 1104 if ( ! empty( $args['enum'] ) ) { 1055 1105 if ( ! in_array( $value, $args['enum'], true ) ) { 1056 1106 /* translators: 1: parameter, 2: list of valid values */ … … function rest_validate_value_from_schema( $value, $args, $param = '' ) { 1152 1202 * 1153 1203 * @param mixed $value The value to sanitize. 1154 1204 * @param array $args Schema array to use for sanitization. 1155 * @return true|WP_Error1205 * @return mixed The sanitized value. 1156 1206 */ 1157 1207 function rest_sanitize_value_from_schema( $value, $args ) { 1208 1209 if ( is_array( $args['type'] ) ) { 1210 1211 $changed = $same = array(); 1212 $empty = null; 1213 1214 foreach ( $args['type'] as $type ) { 1215 $single_typed = $args; 1216 $single_typed['type'] = $type; 1217 1218 $sanitized = rest_sanitize_value_from_schema( $value, $single_typed ); 1219 1220 if ( empty( $sanitized ) && ! is_bool( $sanitized ) ) { 1221 if ( $empty === null ) { 1222 $empty = $sanitized; 1223 } 1224 } elseif ( $sanitized !== $value ) { 1225 $changed[] = $sanitized; 1226 } else { 1227 return $sanitized; 1228 } 1229 } 1230 1231 if ( $changed ) { 1232 return $changed[0]; 1233 } 1234 1235 return $empty; 1236 } 1237 1158 1238 if ( 'array' === $args['type'] ) { 1159 1239 if ( empty( $args['items'] ) ) { 1160 1240 return (array) $value; … … function rest_sanitize_value_from_schema( $value, $args ) { 1170 1250 $value = array_values( $value ); 1171 1251 return $value; 1172 1252 } 1253 1254 if ( 'object' === $args['type'] ) { 1255 if ( ! is_array( $value ) ) { 1256 return array(); 1257 } 1258 1259 // How to sanitize properties that are not registered. 1260 $additional = isset( $args['additionalProperties'] ) ? $args['additionalProperties'] : true; 1261 1262 foreach ( $value as $property => $v ) { 1263 $sanitize = isset( $args['properties'][ $property ] ) ? $args['properties'][ $property ] : $additional; 1264 $value[ $property ] = is_bool( $sanitize ) ? $v : rest_sanitize_value_from_schema( $v, $sanitize ); 1265 } 1266 1267 return $value; 1268 } 1269 1173 1270 if ( 'integer' === $args['type'] ) { 1174 1271 return (int) $value; 1175 1272 } … … function rest_sanitize_value_from_schema( $value, $args ) { 1202 1299 } 1203 1300 1204 1301 if ( 'string' === $args['type'] ) { 1205 return strval( $value );1302 return is_scalar( $value ) ? (string) $value : ''; 1206 1303 } 1207 1304 1208 1305 return $value; -
src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php index 76802fe..f24103d 100644
a b class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { 387 387 388 388 $schema['properties']['caption'] = array( 389 389 'description' => __( 'The attachment caption.' ), 390 'type' => 'object',390 'type' => array( 'object', 'string' ), 391 391 'context' => array( 'view', 'edit', 'embed' ), 392 392 'arg_options' => array( 393 393 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database() … … class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { 409 409 410 410 $schema['properties']['description'] = array( 411 411 'description' => __( 'The attachment description.' ), 412 'type' => 'object',412 'type' => array( 'object', 'string' ), 413 413 'context' => array( 'view', 'edit' ), 414 414 'arg_options' => array( 415 415 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database() -
src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php index e91fce2..0ea97b3 100644
a b class WP_REST_Comments_Controller extends WP_REST_Controller { 1195 1195 ), 1196 1196 'content' => array( 1197 1197 'description' => __( 'The content for the object.' ), 1198 'type' => 'object',1198 'type' => array( 'object', 'string' ), 1199 1199 'context' => array( 'view', 'edit', 'embed' ), 1200 1200 'arg_options' => array( 1201 1201 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database() -
src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php index e04193a..dbc3da3 100644
a b abstract class WP_REST_Controller { 236 236 continue; 237 237 } 238 238 239 if ( 'object' === $schema['properties'][ $key ]['type'] && ! empty( $schema['properties'][ $key ]['properties'] ) ) { 239 $type = (array) $schema['properties'][ $key ]['type']; 240 241 if ( in_array( 'object', $type, true ) && ! empty( $schema['properties'][ $key ]['properties'] ) ) { 240 242 foreach ( $schema['properties'][ $key ]['properties'] as $attribute => $details ) { 241 243 if ( empty( $details['context'] ) ) { 242 244 continue; -
src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index f9de736..4780505 100644
a b class WP_REST_Posts_Controller extends WP_REST_Controller { 1841 1841 case 'title': 1842 1842 $schema['properties']['title'] = array( 1843 1843 'description' => __( 'The title for the object.' ), 1844 'type' => 'object',1844 'type' => array( 'object', 'string' ), 1845 1845 'context' => array( 'view', 'edit', 'embed' ), 1846 1846 'arg_options' => array( 1847 1847 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database() … … class WP_REST_Posts_Controller extends WP_REST_Controller { 1865 1865 case 'editor': 1866 1866 $schema['properties']['content'] = array( 1867 1867 'description' => __( 'The content for the object.' ), 1868 'type' => 'object',1868 'type' => array( 'object', 'string' ), 1869 1869 'context' => array( 'view', 'edit' ), 1870 1870 'arg_options' => array( 1871 1871 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database() … … class WP_REST_Posts_Controller extends WP_REST_Controller { 1903 1903 case 'excerpt': 1904 1904 $schema['properties']['excerpt'] = array( 1905 1905 'description' => __( 'The excerpt for the object.' ), 1906 'type' => 'object',1906 'type' => array( 'object', 'string' ), 1907 1907 'context' => array( 'view', 'edit', 'embed' ), 1908 1908 'arg_options' => array( 1909 1909 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database() -
tests/phpunit/tests/rest-api/rest-schema-sanitization.php
diff --git a/tests/phpunit/tests/rest-api/rest-schema-sanitization.php b/tests/phpunit/tests/rest-api/rest-schema-sanitization.php index e1ae29d..da6d2a4 100644
a b class WP_Test_REST_Schema_Sanitization extends WP_UnitTestCase { 146 146 $this->assertEquals( array( '1', '2' ), rest_sanitize_value_from_schema( array( 'first' => '1', 'second' => '2' ), $schema ) ); 147 147 } 148 148 149 public function test_type_object() { 150 $schema = array( 151 'type' => 'object', 152 'properties' => array( 153 'a' => array( 154 'type' => 'number' 155 ), 156 ), 157 ); 158 $this->assertEquals( array( 'a' => 1 ), rest_sanitize_value_from_schema( array( 'a' => 1 ), $schema ) ); 159 $this->assertEquals( array( 'a' => 1 ), rest_sanitize_value_from_schema( array( 'a' => '1' ), $schema ) ); 160 } 161 162 public function test_type_object_additionalProperties_not_set() { 163 $schema = array( 164 'type' => 'object', 165 'properties' => array( 166 'a' => array( 167 'type' => 'number' 168 ), 169 ), 170 ); 171 $this->assertEquals( array( 'a' => 1 ), rest_sanitize_value_from_schema( array( 'a' => 1 ), $schema ) ); 172 $this->assertEquals( array( 'b' => '1' ), rest_sanitize_value_from_schema( array( 'b' => '1' ), $schema ) ); 173 } 174 175 public function test_type_object_additionalProperties_true() { 176 $schema = array( 177 'type' => 'object', 178 'properties' => array( 179 'a' => array( 180 'type' => 'number' 181 ), 182 ), 183 'additionalProperties' => true, 184 ); 185 $this->assertEquals( array( 'a' => 1 ), rest_sanitize_value_from_schema( array( 'a' => 1 ), $schema ) ); 186 $this->assertEquals( array( 'b' => '1' ), rest_sanitize_value_from_schema( array( 'b' => '1' ), $schema ) ); 187 } 188 189 public function test_type_object_additionalProperties_false() { 190 $schema = array( 191 'type' => 'object', 192 'properties' => array( 193 'a' => array( 194 'type' => 'number' 195 ), 196 ), 197 'additionalProperties' => false, 198 ); 199 $this->assertEquals( array( 'a' => 1 ), rest_sanitize_value_from_schema( array( 'a' => 1 ), $schema ) ); 200 $this->assertEquals( array( 'b' => '1' ), rest_sanitize_value_from_schema( array( 'b' => '1' ), $schema ) ); 201 } 202 203 public function test_type_object_additionalProperties_schema() { 204 $schema = array( 205 'type' => 'object', 206 'properties' => array( 207 'a' => array( 208 'type' => 'number' 209 ), 210 ), 211 'additionalProperties' => array( 212 'type' => 'boolean' 213 ), 214 ); 215 $this->assertEquals( array( 'a' => 1 ), rest_sanitize_value_from_schema( array( 'a' => 1 ), $schema ) ); 216 $this->assertEquals( array( 'b' => true ), rest_sanitize_value_from_schema( array( 'b' => '1' ), $schema ) ); 217 $this->assertEquals( array( 'b' => true ), rest_sanitize_value_from_schema( array( 'b' => true ), $schema ) ); 218 $this->assertEquals( array( 'b' => false ), rest_sanitize_value_from_schema( array( 'b' => 'false' ), $schema ) ); 219 } 220 221 public function test_type_object_nested() { 222 $schema = array( 223 'type' => 'object', 224 'properties' => array( 225 'a' => array( 226 'type' => 'object', 227 'properties' => array( 228 'b' => array( 'type' => 'number' ), 229 'c' => array( 'type' => 'number' ), 230 ) 231 ) 232 ), 233 ); 234 235 $this->assertEquals( 236 array( 'a' => array( 'b' => 1, 'c' => 3 ) ), 237 rest_sanitize_value_from_schema( array( 'a' => array( 'b' => '1', 'c' => '3' ) ), $schema ) 238 ); 239 $this->assertEquals( 240 array( 'a' => array( 'b' => 1, 'c' => 3, 'd' => '1' ), 'b' => '1' ), 241 rest_sanitize_value_from_schema( array( 'a' => array( 'b' => '1', 'c' => '3', 'd' => '1' ), 'b' => 1 ), $schema ) 242 ); 243 $this->assertEquals( array( 'a' => array() ), rest_sanitize_value_from_schema( array( 'a' => null ), $schema ) ); 244 } 245 246 public function test_multiple_types() { 247 $schema = array( 248 'type' => array( 'object', 'string' ) 249 ); 250 $this->assertEquals( 'The content', rest_sanitize_value_from_schema( 'The content', $schema ) ); 251 252 $object = array( 'raw' => 'The content', 'rendered' => 'The rendered content' ); 253 $this->assertEquals( $object, rest_sanitize_value_from_schema( $object, $schema ) ); 254 } 255 256 public function test_multiple_types_applies_sanitization() { 257 $schema = array( 258 'type' => array( 'object', 'boolean' ) 259 ); 260 $this->assertEquals( false, rest_sanitize_value_from_schema( 'false', $schema ) ); 261 262 $object = array( 'prop' => 'false' ); 263 $this->assertEquals( $object, rest_sanitize_value_from_schema( $object, $schema ) ); 264 } 265 266 public function test_multiple_types_empty() { 267 $this->assertEquals( array(), rest_sanitize_value_from_schema( null, array( 'type' => array( 'object', 'string' ) ) ) ); 268 $this->assertEquals( '', rest_sanitize_value_from_schema( null, array( 'type' => array( 'string', 'object' ) ) ) ); 269 } 270 271 public function test_multiple_types_prefers_data_without_change() { 272 $schema = array( 273 'type' => array( 'number', 'string' ) 274 ); 275 $this->assertEquals( '1', rest_sanitize_value_from_schema( '1', $schema ) ); 276 } 277 149 278 public function test_type_unknown() { 150 279 $schema = array( 151 280 'type' => 'lalala', -
tests/phpunit/tests/rest-api/rest-schema-validation.php
diff --git a/tests/phpunit/tests/rest-api/rest-schema-validation.php b/tests/phpunit/tests/rest-api/rest-schema-validation.php index 82f58e5..e610592 100644
a b class WP_Test_REST_Schema_Validation extends WP_UnitTestCase { 181 181 $this->assertWPError( rest_validate_value_from_schema( array( 'first' => '1', 'second' => '2' ), $schema ) ); 182 182 } 183 183 184 public function test_type_object() { 185 $schema = array( 186 'type' => 'object', 187 'properties' => array( 188 'a' => array( 189 'type' => 'number' 190 ), 191 ), 192 ); 193 $this->assertTrue( rest_validate_value_from_schema( array( 'a' => 1 ), $schema ) ); 194 $this->assertWPError( rest_validate_value_from_schema( array( 'a' => 'invalid' ), $schema ) ); 195 } 196 197 public function test_type_object_additionalProperties_not_set() { 198 $schema = array( 199 'type' => 'object', 200 'properties' => array( 201 'a' => array( 202 'type' => 'number' 203 ), 204 ), 205 ); 206 $this->assertTrue( rest_validate_value_from_schema( array( 'b' => 1 ), $schema ) ); 207 } 208 209 public function test_type_object_additionalProperties_true() { 210 $schema = array( 211 'type' => 'object', 212 'properties' => array( 213 'a' => array( 214 'type' => 'number' 215 ), 216 ), 217 'additionalProperties' => true, 218 ); 219 $this->assertTrue( rest_validate_value_from_schema( array( 'a' => 1 ), $schema ) ); 220 $this->assertTrue( rest_validate_value_from_schema( array( 'b' => 1 ), $schema ) ); 221 } 222 223 public function test_type_object_additionalProperties_false() { 224 $schema = array( 225 'type' => 'object', 226 'properties' => array( 227 'a' => array( 228 'type' => 'number' 229 ), 230 ), 231 'additionalProperties' => false, 232 ); 233 $this->assertTrue( rest_validate_value_from_schema( array( 'a' => 1 ), $schema ) ); 234 $this->assertWPError( rest_validate_value_from_schema( array( 'b' => 1 ), $schema ) ); 235 } 236 237 public function test_type_object_additionalProperties_schema() { 238 $schema = array( 239 'type' => 'object', 240 'properties' => array( 241 'a' => array( 242 'type' => 'number' 243 ), 244 ), 245 'additionalProperties' => array( 246 'type' => 'boolean' 247 ), 248 ); 249 $this->assertTrue( rest_validate_value_from_schema( array( 'a' => 1 ), $schema ) ); 250 $this->assertTrue( rest_validate_value_from_schema( array( 'b' => true ), $schema ) ); 251 $this->assertWPError( rest_validate_value_from_schema( array( 'b' => 'invalid' ), $schema ) ); 252 } 253 254 public function test_type_object_nested() { 255 $schema = array( 256 'type' => 'object', 257 'properties' => array( 258 'a' => array( 259 'type' => 'object', 260 'properties' => array( 261 'b' => array( 'type' => 'number' ), 262 'c' => array( 'type' => 'number' ), 263 ) 264 ) 265 ), 266 ); 267 $this->assertTrue( rest_validate_value_from_schema( array( 'a' => array( 'b' => 1, 'c' => 3 ) ), $schema ) ); 268 $this->assertWPError( rest_validate_value_from_schema( array( 'a' => array( 'b' => 1, 'c' => 'invalid' ) ), $schema ) ); 269 $this->assertWPError( rest_validate_value_from_schema( array( 'a' => 1 ), $schema ) ); 270 } 271 184 272 public function test_type_unknown() { 185 273 $schema = array( 186 274 'type' => 'lalala', -
tests/qunit/fixtures/wp-api-generated.js
diff --git a/tests/qunit/fixtures/wp-api-generated.js b/tests/qunit/fixtures/wp-api-generated.js index 679d024..9076538 100644
a b mockedApiResponse.Schema = { 400 400 "title": { 401 401 "required": false, 402 402 "description": "The title for the object.", 403 "type": "object" 403 "type": [ 404 "object", 405 "string" 406 ] 404 407 }, 405 408 "content": { 406 409 "required": false, 407 410 "description": "The content for the object.", 408 "type": "object" 411 "type": [ 412 "object", 413 "string" 414 ] 409 415 }, 410 416 "author": { 411 417 "required": false, … … mockedApiResponse.Schema = { 415 421 "excerpt": { 416 422 "required": false, 417 423 "description": "The excerpt for the object.", 418 "type": "object" 424 "type": [ 425 "object", 426 "string" 427 ] 419 428 }, 420 429 "featured_media": { 421 430 "required": false, … … mockedApiResponse.Schema = { 583 592 "title": { 584 593 "required": false, 585 594 "description": "The title for the object.", 586 "type": "object" 595 "type": [ 596 "object", 597 "string" 598 ] 587 599 }, 588 600 "content": { 589 601 "required": false, 590 602 "description": "The content for the object.", 591 "type": "object" 603 "type": [ 604 "object", 605 "string" 606 ] 592 607 }, 593 608 "author": { 594 609 "required": false, … … mockedApiResponse.Schema = { 598 613 "excerpt": { 599 614 "required": false, 600 615 "description": "The excerpt for the object.", 601 "type": "object" 616 "type": [ 617 "object", 618 "string" 619 ] 602 620 }, 603 621 "featured_media": { 604 622 "required": false, … … mockedApiResponse.Schema = { 1004 1022 "title": { 1005 1023 "required": false, 1006 1024 "description": "The title for the object.", 1007 "type": "object" 1025 "type": [ 1026 "object", 1027 "string" 1028 ] 1008 1029 }, 1009 1030 "content": { 1010 1031 "required": false, 1011 1032 "description": "The content for the object.", 1012 "type": "object" 1033 "type": [ 1034 "object", 1035 "string" 1036 ] 1013 1037 }, 1014 1038 "author": { 1015 1039 "required": false, … … mockedApiResponse.Schema = { 1019 1043 "excerpt": { 1020 1044 "required": false, 1021 1045 "description": "The excerpt for the object.", 1022 "type": "object" 1046 "type": [ 1047 "object", 1048 "string" 1049 ] 1023 1050 }, 1024 1051 "featured_media": { 1025 1052 "required": false, … … mockedApiResponse.Schema = { 1159 1186 "title": { 1160 1187 "required": false, 1161 1188 "description": "The title for the object.", 1162 "type": "object" 1189 "type": [ 1190 "object", 1191 "string" 1192 ] 1163 1193 }, 1164 1194 "content": { 1165 1195 "required": false, 1166 1196 "description": "The content for the object.", 1167 "type": "object" 1197 "type": [ 1198 "object", 1199 "string" 1200 ] 1168 1201 }, 1169 1202 "author": { 1170 1203 "required": false, … … mockedApiResponse.Schema = { 1174 1207 "excerpt": { 1175 1208 "required": false, 1176 1209 "description": "The excerpt for the object.", 1177 "type": "object" 1210 "type": [ 1211 "object", 1212 "string" 1213 ] 1178 1214 }, 1179 1215 "featured_media": { 1180 1216 "required": false, … … mockedApiResponse.Schema = { 1542 1578 "title": { 1543 1579 "required": false, 1544 1580 "description": "The title for the object.", 1545 "type": "object" 1581 "type": [ 1582 "object", 1583 "string" 1584 ] 1546 1585 }, 1547 1586 "author": { 1548 1587 "required": false, … … mockedApiResponse.Schema = { 1588 1627 "caption": { 1589 1628 "required": false, 1590 1629 "description": "The attachment caption.", 1591 "type": "object" 1630 "type": [ 1631 "object", 1632 "string" 1633 ] 1592 1634 }, 1593 1635 "description": { 1594 1636 "required": false, 1595 1637 "description": "The attachment description.", 1596 "type": "object" 1638 "type": [ 1639 "object", 1640 "string" 1641 ] 1597 1642 }, 1598 1643 "post": { 1599 1644 "required": false, … … mockedApiResponse.Schema = { 1682 1727 "title": { 1683 1728 "required": false, 1684 1729 "description": "The title for the object.", 1685 "type": "object" 1730 "type": [ 1731 "object", 1732 "string" 1733 ] 1686 1734 }, 1687 1735 "author": { 1688 1736 "required": false, … … mockedApiResponse.Schema = { 1728 1776 "caption": { 1729 1777 "required": false, 1730 1778 "description": "The attachment caption.", 1731 "type": "object" 1779 "type": [ 1780 "object", 1781 "string" 1782 ] 1732 1783 }, 1733 1784 "description": { 1734 1785 "required": false, 1735 1786 "description": "The attachment description.", 1736 "type": "object" 1787 "type": [ 1788 "object", 1789 "string" 1790 ] 1737 1791 }, 1738 1792 "post": { 1739 1793 "required": false, … … mockedApiResponse.Schema = { 3091 3145 "content": { 3092 3146 "required": false, 3093 3147 "description": "The content for the object.", 3094 "type": "object" 3148 "type": [ 3149 "object", 3150 "string" 3151 ] 3095 3152 }, 3096 3153 "date": { 3097 3154 "required": false, … … mockedApiResponse.Schema = { 3215 3272 "content": { 3216 3273 "required": false, 3217 3274 "description": "The content for the object.", 3218 "type": "object" 3275 "type": [ 3276 "object", 3277 "string" 3278 ] 3219 3279 }, 3220 3280 "date": { 3221 3281 "required": false,