Skip to content
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

Cast number schema should return float #610

Closed
David-Klemenc opened this issue May 24, 2024 · 1 comment
Closed

Cast number schema should return float #610

David-Klemenc opened this issue May 24, 2024 · 1 comment

Comments

@David-Klemenc
Copy link
Contributor

David-Klemenc commented May 24, 2024

OpenApiSpex.Schema.cast and OpenApiSpex.cast_value return different results when casting 1

iex> float_schema = %OpenApiSpex.Schema{type: :number, format: :float}
%OpenApiSpex.Schema%{type: :number, format: :float}
iex> OpenApiSpex.Schema.cast(float_schema, 1, %{})
{:ok, 1.0}
iex> OpenApiSpex.cast_value(1, float_schema)
{:ok, 1}

The correct response should be {:ok, 1.0} for OpenApiSpex.cast_value(1, float_schema)

This is a simlar issue to: #84

@mbuhot
Copy link
Collaborator

mbuhot commented Jul 8, 2024

Fixed in #611, thanks @David-Klemenc

@mbuhot mbuhot closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants