Skip to content
Prev Previous commit
Next Next commit
Add test case : arbitraryObjectResponseArray
  • Loading branch information
ackintosh committed Dec 31, 2018
commit 3ff0f49e71301d65d0197c8025a0a633f970efef
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,25 @@ public void arbitraryObjectResponse() {
assertNull(mediaType.getSchema().getProperties());
}


@Test
public void arbitraryObjectResponseArray() {
OpenAPI openAPI = new OpenAPIParser().readLocation("src/test/resources/3_0/inline_model_resolver.yaml", null, new ParseOptions()).getOpenAPI();
new InlineModelResolver().flatten(openAPI);

MediaType mediaType = openAPI
.getPaths()
.get("/arbitrary_object_response_array")
.getGet()
.getResponses()
.get("200")
.getContent()
.get("application/json");

assertTrue(mediaType.getSchema() instanceof ArraySchema);
ArraySchema schema = (ArraySchema) mediaType.getSchema();
assertNull(schema.getItems().getProperties());
}
/*
@Test
public void testArbitraryObjectResponseArray() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,18 @@ paths:
application/json:
schema:
type: object
/arbitrary_object_response_array:
get:
operationId: arbitraryObjectResponseArray
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
type: object
components:
schemas:
Users:
Expand Down