[SOLVED] PUT 400 on array property

I have…

I’m submitting a…

  • [x] Regression (a behavior that stopped working in a new release)
  • [ ] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

When I try to edit an array with just one element I am getting a validation error about the second element.

The response payload:

{
   "message":"Validation error",
   "traceId":"|79ee11aa-4dde520fff0c400e.",
   "type":"https://tools.ietf.org/html/rfc7231#section-6.5.1",
   "details":[
      "teams[1].id: Field is required."
   ],
   "statusCode":400

}

The payload of the request:

{
   "teams":{
      "iv":[
         {
            "id":[
               "034df4c4-49b1-4adb-b988-f76765b99f40"
            ],
            "role":"Lead PI",
            "responsibilities":"Responsibilities"
         }
      ]
   }
}

Expected behavior

The expectation is that the request changes the data and returns 200.

Minimal reproduction of the problem

Environment

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [x] Cloud version

Browser:

  • [x] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:

The relevant part of the document schema is the following:

{
        "name": "teams",
        "properties": {
            "fieldType": "Array",
            "label": "Teams"
        },
        "partitioning": "invariant",
        "nested": [
            {
                "name": "id",
                "properties": {
                    "isRequired": true,
                    "fieldType": "References",
                    "editor": "List",
                    "maxItems": 1,
                    "resolveReference": true,
                    "schemaIds": [
                        "d4bf83a6-1b7c-4eb1-92e0-dd5a451fd477"
                    ],
                    "label": "ID"
                }
            },
            {
                "name": "role",
                "properties": {
                    "isRequired": true,
                    "fieldType": "String",
                    "editor": "Dropdown",
                    "allowedValues": [
                        "Lead PI",
                        "Co-Investigator",
                        "Project Manager",
                        "Collaborator",
                        "Key Personnel"
                    ],
                    "contentType": "Unspecified",
                    "label": "Role"
                }
            },
            {
                "name": "approach",
                "properties": {
                    "fieldType": "String",
                    "editor": "Input",
                    "contentType": "Unspecified",
                    "label": "Main Research Interests"
                }
            },
            {
                "name": "responsibilities",
                "properties": {
                    "fieldType": "String",
                    "editor": "Input",
                    "contentType": "Unspecified",
                    "label": "Responsibilities"
                }
            }
        ]
    },

I am going to change this, but the messages are currently with [1…N] indexer.

It looks okay, actually.

It is a bug, I recommend to remove the “isRequired” flag an I will fix it.

1 Like

I have deployed a potential fix.

This topic was automatically closed after 2 days. New replies are no longer allowed.