Skip to content

Commit

Permalink
Merge pull request #1096 from ymohdriz/issue1070
Browse files Browse the repository at this point in the history
Issue1070
  • Loading branch information
gracekarina committed Nov 6, 2020
2 parents 1f9130c + fcb7e8f commit 33f6b4f
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,14 @@ public void testIssue1003_ExtensionsClassloader() {
}

@Test
public void testIssue1070() {
SwaggerParseResult result = new OpenAPIParser().readLocation("issue1070.yaml", null, null);
List required = result.getOpenAPI().getComponents().getSchemas().get("AmountAndCurrency").getRequired();
assertEquals(required.size(), 2);
assertTrue(required.contains("Amount"));
assertTrue(required.contains("Currency"));
}

public void testIssue1086() {
OpenAPIParser openApiParser = new OpenAPIParser();
ParseOptions options = new ParseOptions();
Expand Down
52 changes: 52 additions & 0 deletions modules/swagger-parser/src/test/resources/issue1070.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
openapi: 3.0.0
info:
version: 0.0.0
title: "test"
components:
schemas:
AmountAndCurrency:
additionalProperties: false
description: >-
Amount with a currency.
properties:
Amount:
$ref: '#/components/schemas/AssessCandidate'
Currency:
description: >-
Representation of currencies and funds".
pattern: '^[A-Z]{3,3}$'
type: string
required:
- Amount
- Currency
type: object
AssessCandidate:
type: object
properties:
candidate:
type: object
properties:
id:
type: string
required:
- id
test_results:
type: object
properties:
id:
type: string
status:
type: string
score:
type: number
multipleOf: 1
date:
type: string
format: date
comment:
type: string
result_url:
type: string
required:
- candidate
- test_results

0 comments on commit 33f6b4f

Please sign in to comment.