Open
Description
API Platform version(s) affected: 4.0.3
Description
If you introspect the API Platform data and look at the Filter Params, there is a property "isRequired". It is always false no matter what I do with the API Platform configuration.
The FilterGuesser seems to want to evaluate that property to determine whether a filter should be "alwaysOn"... but I can't find any way tot set it.
How to reproduce
Create a Doctrine Entity with a SearchFilter configured.
In RA, introspect the API with something like this:
export function ETLogIntrospectedApiData() {
const dataProvider = useDataProvider();
const resourceName = useResourceContext();
const schemaAnalyzer = hydraSchemaAnalyzer();
dataProvider.introspect().then(({ data }: { data: Api }) => {
console.log("API Data:", data);
if (data && data.resources) {
const resource = data.resources.find((res) => res.name === resourceName);
if (resource) {
schemaAnalyzer
.getFiltersParametersFromSchema(resource)
.then((params) => {
console.log("Filter Params:", params);
});
schemaAnalyzer.getOrderParametersFromSchema(resource).then((params) => {
console.log("Order Params:", params);
});
}
}
});
}
Notice in the console the Filter Params have an isRequired property set to false.
There are no docs about how to set it to true and various things I've tried with ApiProperty aren't working.
Metadata
Metadata
Assignees
Labels
No labels