We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
if property is set to :null or nil in schema's example, it's filtered out by if PhoenixSwagger.to_json/1 here is an example:
:null
nil
PhoenixSwagger.to_json/1
Interactive Elixir (1.13.4) - press Ctrl+C to exit (type h() ENTER for help) iex(1)> use PhoenixSwagger PhoenixSwagger.JsonApi iex(2)> swagger_schema do ...(2)> property(:someProperty, [:null, :string], "some nullable property") ...(2)> example(%{someProperty: :null}) ...(2)> end %{ "example" => %{}, "properties" => %{ "someProperty" => %{ "description" => "some nullable property", "type" => [:null, "string"] } }, "type" => "object" } iex(3)> swagger_schema do ...(3)> property(:someProperty, [:null, :string], "some nullable property") ...(3)> example(%{someProperty: nil}) ...(3)> end %{ "example" => %{}, "properties" => %{ "someProperty" => %{ "description" => "some nullable property", "type" => [:null, "string"] } }, "type" => "object" } iex(4)> swagger_schema do ...(4)> property(:someProperty, [:null, :string], "some nullable property") ...(4)> example(%{someProperty: "some_value"}) ...(4)> end %{ "example" => %{"someProperty" => "some_value"}, "properties" => %{ "someProperty" => %{ "description" => "some nullable property", "type" => [:null, "string"] } }, "type" => "object" }
The text was updated successfully, but these errors were encountered:
@DenysGonchar use the master branch instead of the old hex version
Sorry, something went wrong.
#162
No branches or pull requests
if property is set to
:null
ornil
in schema's example, it's filtered out by ifPhoenixSwagger.to_json/1
here is an example:
The text was updated successfully, but these errors were encountered: