Skip to content

Commit

Permalink
fix: properly reflect that default: false makes a non required attr…
Browse files Browse the repository at this point in the history
…ibute
  • Loading branch information
zachdaniel committed Jun 11, 2024
1 parent 0c93bfb commit d935a45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ash_json_api/json_schema/json_schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ defmodule AshJsonApi.JsonSchema do
resource
|> Ash.Resource.Info.attributes()
|> Enum.filter(&(&1.name in action.accept && &1.writable?))
|> Enum.reject(&(&1.allow_nil? || &1.default || &1.generated?))
|> Enum.reject(&(&1.allow_nil? || not is_nil(&1.default) || &1.generated?))
|> Enum.map(&to_string(&1.name))

arguments =
Expand Down
2 changes: 1 addition & 1 deletion lib/ash_json_api/json_schema/open_api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ if Code.ensure_loaded?(OpenApiSpex) do
resource
|> Ash.Resource.Info.attributes()
|> Enum.filter(&(&1.name in action.accept && &1.writable?))
|> Enum.reject(&(&1.allow_nil? || &1.default || &1.generated?))
|> Enum.reject(&(&1.allow_nil? || not is_nil(&1.default) || &1.generated?))
|> Enum.map(& &1.name)

arguments =
Expand Down

0 comments on commit d935a45

Please sign in to comment.