Skip to content

Commit 4edce60

Browse files
committed
Test case for issue 1086
1 parent 0cb2c9b commit 4edce60

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

modules/swagger-parser/src/test/java/io/swagger/parser/OpenAPIParserTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import io.swagger.v3.oas.models.Components;
44
import io.swagger.v3.oas.models.OpenAPI;
55
import io.swagger.v3.oas.models.media.ArraySchema;
6+
import io.swagger.v3.oas.models.media.ObjectSchema;
67
import io.swagger.v3.oas.models.media.Schema;
78
import io.swagger.v3.oas.models.PathItem;
89

@@ -496,6 +497,17 @@ public void testIssue1003_ExtensionsClassloader() {
496497
}
497498
assertNotNull(api);
498499
}
500+
501+
@Test
502+
public void testIssue1086() {
503+
OpenAPIParser openApiParser = new OpenAPIParser();
504+
ParseOptions options = new ParseOptions();
505+
OpenAPI openAPI = openApiParser.readLocation("issue1086.yaml", null, options).getOpenAPI();
506+
Map<String, Schema> schemas = openAPI.getComponents().getSchemas();
507+
ObjectSchema schema = (ObjectSchema) schemas.get("AssessCandidate").getProperties().get("test_results");
508+
Schema score = schema.getProperties().get("score");
509+
assertEquals(score.getMultipleOf().intValue(), 1);
510+
}
499511

500512
}
501513

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
openapi: 3.0.0
2+
info:
3+
version: 0.0.0
4+
title: "test"
5+
components:
6+
schemas:
7+
AssessCandidate:
8+
type: object
9+
properties:
10+
candidate:
11+
type: object
12+
properties:
13+
id:
14+
type: string
15+
required:
16+
- id
17+
test_results:
18+
type: object
19+
properties:
20+
id:
21+
type: string
22+
status:
23+
type: string
24+
score:
25+
type: number
26+
multipleOf: 1
27+
date:
28+
type: string
29+
format: date
30+
comment:
31+
type: string
32+
result_url:
33+
type: string
34+
required:
35+
- candidate
36+
- test_results

0 commit comments

Comments
 (0)