Skip to content

attributesToRetrieve parameter ignored when passed as escaped JSON string #55

@pierrerognion

Description

@pierrerognion

Hi Algolia team,

I'm experiencing an issue where the attributesToRetrieve parameter is being ignored in search requests.

Current Behavior:
When I send a search request with:

javascript
{
  query: "project manager",
  attributesToRetrieve: "[\"id\", \"title\", \"skills\"]"
}

The API returns all document attributes instead of just the specified ones.

Expected Behavior:
Only the specified attributes (id, title, skills) should be returned.

Questions:
Should attributesToRetrieve accept string format with escaped JSON?
Is there a recommended way to handle this when the parameter comes as a string?

Is this the recommended approach, or is there a better solution?
Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions