-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 'AllOf cast returns a map, but I expected a struct' #592
Merged
Conversation
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
zorbash
reviewed
Jan 16, 2024
test/cast/all_of_test.exs
Outdated
@@ -355,6 +355,8 @@ defmodule OpenApiSpex.CastAllOfTest do | |||
|
|||
test "with schema having x-type" do | |||
value = %{fur: true, meow: true} | |||
assert {:ok, _} = cast(value: value, schema: CatSchema.schema()) | |||
|
|||
assert {:ok, %OpenApiSpex.CastAllOfTest.CatSchema{fur: true, meow: true}} = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit]
diff --git a/test/cast/all_of_test.exs b/test/cast/all_of_test.exs
index 93487fa..9f2fbab 100644
--- a/test/cast/all_of_test.exs
+++ b/test/cast/all_of_test.exs
@@ -356,7 +356,6 @@ defmodule OpenApiSpex.CastAllOfTest do
test "with schema having x-type" do
value = %{fur: true, meow: true}
- assert {:ok, %OpenApiSpex.CastAllOfTest.CatSchema{fur: true, meow: true}} =
- cast(value: value, schema: CatSchema.schema())
+ assert {:ok, %CatSchema{fur: true, meow: true}} = cast(value: value, schema: CatSchema.schema())
end
end
zorbash
approved these changes
Jan 16, 2024
hou8
pushed a commit
to hou8/open_api_spex
that referenced
this pull request
Apr 18, 2024
…x#592) * Add failing test * Cast result of AllOf cast into a struct * Shorter module name
hamir-suspect
added a commit
to renderedtext/open_api_spex
that referenced
this pull request
May 14, 2024
* Exclude empty paths from spec (open-api-spex#583) * Exclude empty paths from spec * fix: assert_operation_response header lookup (open-api-spex#584) * fix: assert_operation_response header lookup * Release version 3.18.1 * Fix 'AllOf cast returns a map, but I expected a struct' (open-api-spex#592) * Add failing test * Cast result of AllOf cast into a struct * Shorter module name * Add missing NoneCache test * Release version 3.18.2 * Relax dependency constraint on ymlr to allow version ~> 5.0 (open-api-spex#586) * relax dependency on ymlr, and fix some tests * test with more elixir versions * Update Elixir version test matrix (open-api-spex#602) * Update Elixir version test matrix * Fix map key order dependent test * Release version 3.18.3 * Support response code ranges See: https://swagger.io/docs/specification/describing-responses/ * Release version 3.19.0 * Add notice that body params are not merged into Conn.params whne using cast and validate plug (open-api-spex#589) * Set nonces on <script> and <style> elements if configured (open-api-spex#593) * Allow script and style nonces * Allow nonces on the SwaggerUIOAuth2Redirect plug as well --------- Co-authored-by: Alisina Bahadori <alisina.bm@gmail.com> Co-authored-by: Matt Sutkowski <msutkowski@gmail.com> Co-authored-by: Dimitris Zorbas <dimitrisplusplus@gmail.com> Co-authored-by: Angelika Tyborska <angelikatyborska@fastmail.com> Co-authored-by: Aleksandr Lossenko <aleksandr.lossenko@memsource.com> Co-authored-by: Nathan Alderson <me@nathanalderson.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #590