Skip to content

Fix object type thing + config for backwards compat + a regression in deps update#413

Merged
zachdaniel merged 3 commits intoash-project:mainfrom
olivermt:main
Feb 3, 2026
Merged

Fix object type thing + config for backwards compat + a regression in deps update#413
zachdaniel merged 3 commits intoash-project:mainfrom
olivermt:main

Conversation

@olivermt
Copy link
Contributor

@olivermt olivermt commented Feb 2, 2026

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

The filter schema type `deepObject` is technically invalid per the
OpenAPI spec (it's only valid for the `style` property, not `type`),
but works better with Swagger UI.

This adds a config option to opt-in to the spec-compliant `object` type:

    config :ash_json_api, correct_filter_schema_type?: true

The default remains `deepObject` for backwards compatibility with
Swagger UI.
By default, the filter schema uses `deepObject` as its type, which works well with Swagger UI but is technically invalid per the OpenAPI spec (`deepObject` is only valid for the `style` property, not `type`). If you need a spec-compliant schema, you can opt-in to use the correct `object` type:

```elixir
config :ash_json_api, correct_filter_schema_type?: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be more clear like use_deep_object_for_filter_type?: false, defaulting to true? Name doesn't say much on its own about what it does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Force pushed a new variant based on this feedback

The filter schema type `deepObject` is technically invalid per the
OpenAPI spec (it's only valid for the `style` property, not `type`),
but works better with Swagger UI.

This adds a config option to opt out of the `deepObject` type:

    config :ash_json_api, use_deep_object_for_filter_type?: false

The default remains `deepObject` (true) for backwards compatibility
with Swagger UI.
Update tests to include the new filter operators added in recent Ash versions.
@zachdaniel zachdaniel merged commit 5c56490 into ash-project:main Feb 3, 2026
22 of 23 checks passed
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

Successfully merging this pull request may close these issues.

2 participants