-
-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f136047
commit c1219e3
Showing
6 changed files
with
84 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package openapi3 | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestIssue638(t *testing.T) { | ||
for i := 0; i < 50; i++ { | ||
loader := NewLoader() | ||
loader.IsExternalRefsAllowed = true | ||
// This path affects the occurrence of the issue #638. | ||
// ../openapi3/testdata/issue638/test1.yaml : reproduce | ||
// ./testdata/issue638/test1.yaml : not reproduce | ||
// testdata/issue638/test1.yaml : reproduce | ||
doc, err := loader.LoadFromFile("testdata/issue638/test1.yaml") | ||
require.NoError(t, err) | ||
require.Equal(t, "int", doc.Components.Schemas["test1d"].Value.Type) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
openapi: "3.0.0" | ||
info: | ||
version: 1.0.0 | ||
title: reference test part 1 | ||
description: reference test part 1 | ||
components: | ||
schemas: | ||
test1a: | ||
$ref: "test2.yaml#/components/schemas/test2a" | ||
test1b: | ||
$ref: "#/components/schemas/test1c" | ||
test1c: | ||
type: int | ||
test1d: | ||
$ref: "test2.yaml#/components/schemas/test2b" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
openapi: "3.0.0" | ||
info: | ||
version: 1.0.0 | ||
title: reference test part 2 | ||
description: reference test part 2 | ||
components: | ||
schemas: | ||
test2a: | ||
type: number | ||
test2b: | ||
$ref: "test1.yaml#/components/schemas/test1b" | ||
test1c: | ||
type: string |