Skip to content

Commit

Permalink
Relax dependency constraint on ymlr to allow version ~> 5.0 (#586)
Browse files Browse the repository at this point in the history
* relax dependency on ymlr, and fix some tests

* test with more elixir versions
  • Loading branch information
Aleksandr Lossenko authored Feb 13, 2024
1 parent d9cfffe commit 844f24a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,17 @@ jobs:
name: Test (OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}})
strategy:
matrix:
otp: ['22', '23', '24', '25']
elixir: ['1.11', '1.12', '1.13']
otp: ['22', '23', '24', '25', '26']
elixir: ['1.11', '1.12', '1.13', '1.14', '1.15', '1.16']
exclude:
- {otp: '25', elixir: '1.10'}
- {otp: '25', elixir: '1.11'}
- {otp: '25', elixir: '1.12'}
- {otp: '26', elixir: '1.10'}
- {otp: '26', elixir: '1.11'}
- {otp: '26', elixir: '1.12'}
- {otp: '26', elixir: '1.13'}
- {otp: '26', elixir: '1.14'}
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ defmodule OpenApiSpex.Mixfile do
{:phoenix, "~> 1.3", only: [:dev, :test]},
{:plug, "~> 1.7"},
{:poison, "~> 3.0 or ~> 4.0 or ~> 5.0", optional: true},
{:ymlr, "~> 2.0 or ~> 3.0 or ~> 4.0", optional: true}
{:ymlr, "~> 2.0 or ~> 3.0 or ~> 4.0 or ~> 5.0", optional: true}
]
end

Expand Down
6 changes: 5 additions & 1 deletion test/cast/object_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,11 @@ defmodule OpenApiSpex.ObjectTest do
}
}

assert {:error, [error1, error2]} = cast(value: %{"age" => 0, "name" => "N"}, schema: schema)
assert {:error, [_error1, _error2] = errors} =
cast(value: %{"age" => 0, "name" => "N"}, schema: schema)

error1 = Enum.find(errors, &(&1.path == [:age]))
error2 = Enum.find(errors, &(&1.path == [:name]))

assert %Error{} = error1
assert error1.reason == :minimum
Expand Down
4 changes: 2 additions & 2 deletions test/paths_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ defmodule OpenApiSpex.PathsTest do
refute Map.has_key?(paths, "/api/noapi")
refute Map.has_key?(paths, "/api/noapi_with_struct")

assert pets_path_item.patch.operationId == "OpenApiSpexTest.PetController.update"
assert pets_path_item.put.operationId == "OpenApiSpexTest.PetController.update (2)"
assert pets_path_item.put.operationId == "OpenApiSpexTest.PetController.update"
assert pets_path_item.patch.operationId == "OpenApiSpexTest.PetController.update (2)"
end
end
end

0 comments on commit 844f24a

Please sign in to comment.