Skip to content

7.0 Query serializer settings for trailing commas? #4128

Closed
@niemyjski

Description

@niemyjski

I'm using the latest version of (7.3.1) nest and I'm going to be digging into this but I figured I'd log it in case it's something simple but we are using nest to build up a query and we just got the following error: json_parse_exception Reason: "Unexpected character (']' (code 93)): expected a value

I'm tracking it down but it seems our sort query has a trailing , before the end of the sort array.

  "sort": [
    {
      "test.long-000004": {
        "nested": {
          "filter": {
            "term": {
              "tester.userId": {
                "value": "5d9f919617d7af597fd8a451"
              }
            }
          },
          "path": "tester"
        },
        "order": "asc"
      }
    },
  ],

In our visitor we are setting the nodes content for sort to something like this:

new FieldSort
                        {
                            Field = node.Field,
                            Nested = new NestedSort
                            {
                                Path = path,
                                Filter = Query<TEST>.Term(f => f.UserId, userid)
                            },
                            Order = node.IsNodeOrGroupNegated() ? SortOrder.Descending : SortOrder.Ascending
                        }

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