Skip to content

Commit fe9ff2b

Browse files
authored
Merge pull request #1095 from ymohdriz/issue1086
Test case for issue 1086
2 parents a33a2c2 + 84024ce commit fe9ff2b

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

@@ -538,6 +539,17 @@ public void testIssue1003_ExtensionsClassloader() {
538539
}
539540
assertNotNull(api);
540541
}
542+
543+
@Test
544+
public void testIssue1086() {
545+
OpenAPIParser openApiParser = new OpenAPIParser();
546+
ParseOptions options = new ParseOptions();
547+
OpenAPI openAPI = openApiParser.readLocation("issue1086.yaml", null, options).getOpenAPI();
548+
Map<String, Schema> schemas = openAPI.getComponents().getSchemas();
549+
ObjectSchema schema = (ObjectSchema) schemas.get("AssessCandidate").getProperties().get("test_results");
550+
Schema score = schema.getProperties().get("score");
551+
assertEquals(score.getMultipleOf().intValue(), 1);
552+
}
541553

542554
}
543555

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)