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

FieldGuesser Not Reflecting State of OrderFilter #592

Open
grichards opened this issue Jan 15, 2025 · 0 comments
Open

FieldGuesser Not Reflecting State of OrderFilter #592

grichards opened this issue Jan 15, 2025 · 0 comments

Comments

@grichards
Copy link

API Platform version(s) affected: 4.0.3

Description
In my , all 's are behaving as "sortable={true}", despite only a subset of property names being configured in the OrderFilter.

How to reproduce

  1. Create a Doctrine Entity
  2. Add an OrderFilter with limited sortable properties like this: `#[ApiFilter(OrderFilter::class, properties: ['name'])]
  3. Create a corresponding ApiPlatform Admin Resource with a ListGuesser and multiple FieldGuessers
  4. See that all field headers look sortable from a UI perspective, although only "name" will function as sortable, because the API actually works as expected.
    `

Possible Solution
My guess is that in FieldGuesser::isFieldSortable(), schema.parameters is not resolved. Shouldn't that be using SchemaAnalyzer? Like schemaAnalyzer .getOrderParametersFromSchema(schema)

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

1 participant