Skip to content

Elasticsearch Denormalizer returns null for fields composed of two ore more words (ex. firstName) #4053

Open
@imaximius

Description

@imaximius

API Platform version(s) affected: 2.6.3

Description
As mentioned in summary there is an issue with getting data form Elasticsearch. It reproduced when I tried to get data for fields that composed of several words (ex. firstName, createdAt etc.) Result the same for jsonld and graphql normalizers and for nested objects as well.

How to reproduce

  1. Enable support for Elasticsearch
  2. Create model and field with two words name
  3. Store some data
  4. Try to get data by using jsonld or graphql formats
  5. Result for fields with two words name will be empty

Possible Solution
There is could be a bug with comparing allowedAttributes to attributes from ES result. Method getAllowedAttributes of AbstractObjectNormalizer returns allowed attributes in camel case whereas attributes in ES source wrote in snake_case

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions