Announcement Announcement Module
Collapse
No announcement yet.
How to POST payload with collection? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to POST payload with collection?

    I'm getting the following error message when I try and post a collection using spring data rest.

    What am i missing?

    Code:
    {
      "cause" : {
        "cause" : {
          "cause" : null,
          "message" : null
        },
        "message" : "(was java.lang.NullPointerException) (through reference chain: com.model.Appointment[\"products\"])"
      },
      "message" : "Could not read JSON: (was java.lang.NullPointerException) (through reference chain: com.model.Appointment[\"products\"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: com.model.Appointment[\"products\"])"
    }
    This is the payload I'm using.

    Code:
    {
      "trackNumber" : "XYZ123",
      "projectCode" : "TYE",
      "requestType" : "ORDER",
      "lastName" : "YOUNG",
      "firstName" : "ZACH",
      "addressLine1" : "857 test",
      "addressLine2" : "",
      "city" : "SPRING",
      "state" : "AR",
      "postalCode" : "727264",
      "email" : "[email protected]",
      "date" : "2014-03-19T00:00:00.000Z",
      "status" : "A",
      "products" : [ {
              "model" : "TEST",
            "description" : "TEST",
            "quantity" : 1,
            "status" : "A"        
          } ]
    }

  • #2
    Any help with this question?

    Comment

    Working...
    X