-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
10 changed files
with
95 additions
and
5 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
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,15 @@ | ||
defmodule ExonerateTest.RefNotFoundRoot do | ||
require Exonerate | ||
|
||
Exonerate.function_from_string( | ||
:defp, | ||
:yaml, | ||
""" | ||
type: object | ||
parameters: | ||
foo: | ||
$ref: "#/definitions/foo" | ||
""", | ||
encoding: "application/yaml" | ||
) | ||
end |
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 @@ | ||
defmodule ExonerateTest.RefNotFoundTest do | ||
use ExUnit.Case, async: true | ||
|
||
test "if there's a missing ref, we get a CompileError" do | ||
assert_raise CompileError, | ||
"reference points to: #/definitions/foo, this location not found in the schema", | ||
fn -> | ||
__DIR__ | ||
|> Path.join("ref_not_found_root.exs") | ||
|> Code.compile_file() | ||
end | ||
end | ||
end |
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
File renamed without changes.
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,25 @@ | ||
defmodule ExonerateTest.Regression.NestedRefTest do | ||
require Exonerate | ||
|
||
# combining an entrypoint with a $ref fails. | ||
Exonerate.function_from_string( | ||
:def, | ||
:ref_trace_entrypoint, | ||
~S""" | ||
schema: | ||
type: object | ||
properties: | ||
bar: | ||
$ref: '#/one' | ||
one: | ||
type: object | ||
properties: | ||
foo: | ||
$ref: '#/two' | ||
two: | ||
type: string | ||
""", | ||
encoding: "application/yaml", | ||
entrypoint: "/schema" | ||
) | ||
end |