File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 8
8
import io .swagger .v3 .oas .models .PathItem ;
9
9
import io .swagger .v3 .oas .models .media .ArraySchema ;
10
10
import io .swagger .v3 .oas .models .media .ComposedSchema ;
11
- import io .swagger .v3 .oas .models .media .ObjectSchema ;
12
11
import io .swagger .v3 .oas .models .media .Schema ;
13
12
import io .swagger .v3 .parser .OpenAPIV3Parser ;
14
13
import io .swagger .v3 .parser .core .models .ParseOptions ;
@@ -236,9 +235,9 @@ public void testIssue421() {
236
235
assertNotNull (swagger .getPaths ().get ("/pet/{petId}" ).getPost ().getParameters ());
237
236
assertTrue (swagger .getPaths ().get ("/pet/{petId}" ).getPost ().getParameters ().size () == 1 );
238
237
assertTrue (swagger .getPaths ().get ("/pet/{petId}" ).getPost ().getRequestBody () != null );
239
- assertTrue (swagger .getPaths ().get ("/pet/{petId}" ).getPost ().getRequestBody ().getContent () != null );
240
- assertTrue (swagger .getPaths ().get ("/pet/{petId}" ).getPost ().getRequestBody ().getContent (). get ( "application/x-www-form-urlencoded" ) != null );
241
- assertTrue (swagger .getPaths ().get ("/pet/{petId}" ).getPost ().getRequestBody ().getContent ().get ( "application/x-www-form-urlencoded" ). getSchema () instanceof ObjectSchema );
238
+ assertTrue (swagger .getPaths ().get ("/pet/{petId}" ).getPost ().getRequestBody ().get$ref () != null );
239
+ assertEquals (swagger .getPaths ().get ("/pet/{petId}" ).getPost ().getRequestBody ().get$ref (), "#/components/requestBodies/requestBody" );
240
+ assertTrue (swagger .getPaths ().get ("/pet/{petId}" ).getPost ().getRequestBody ().get$ref ().equals ( "#/components/requestBodies/requestBody" ) );
242
241
243
242
assertNotNull (swagger .getPaths ().get ("/store/order" ));
244
243
assertNotNull (swagger .getPaths ().get ("/store/order" ).getPost ());
Original file line number Diff line number Diff line change @@ -346,9 +346,7 @@ public void componentsResolver() throws Exception {
346
346
// internal callback reference
347
347
assertEquals (callbacks .get ("referenced" ).get$ref (),"#/components/callbacks/failed" );
348
348
//callback pathItem -> operation ->requestBody
349
- assertTrue (callbacks .get ("heartbeat" ).get ("$request.query.heartbeat-url" ).getPost ().getRequestBody ().getContent () != null );
350
- assertTrue (callbacks .get ("heartbeat" ).get ("$request.query.heartbeat-url" ).getPost ().getRequestBody ().getContent ().get ("application/json" ).getSchema () instanceof ArraySchema );
351
- assertEquals (((ArraySchema ) callbacks .get ("heartbeat" ).get ("$request.query.heartbeat-url" ).getPost ().getRequestBody ().getContent ().get ("application/json" ).getSchema ()).getItems ().get$ref (),"#/components/schemas/User" );
349
+ assertEquals (callbacks .get ("heartbeat" ).get ("$request.query.heartbeat-url" ).getPost ().getRequestBody ().get$ref (),"#/components/requestBodies/requestBody3" );
352
350
//remote callback ref
353
351
assertEquals (callbacks .get ("remoteCallback" ).get$ref (),"#/components/callbacks/callback" );
354
352
You can’t perform that action at this time.
0 commit comments