Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

No Way to Set "isRequired" to True in Filter Params

Open
#595 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
react, typescript
Domain
api, frontend

Research direction

Start with hydraSchemaAnalyzer.getFiltersParametersFromSchema and trace how FilterGuesser consumes isRequired and determines alwaysOn. Reproduce the reported SearchFilter and ApiProperty configurations, then verify that a supported configuration produces the expected required value in the introspected Filter Params.

Written by the indexing model from the issue text.

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.

Dominant language
TypeScript
Stars
516
Forks
134
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from api-platform/admin

All issues in api-platform/admin

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.