Announcement Announcement Module
Collapse
No announcement yet.
How to create a JSON for object that has ManyToOne relationship with another object? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to create a JSON for object that has ManyToOne relationship with another object?

    Hi,

    I'm having problem to figure out on how to send a POST request to create and object that has ManyToOne relationship with another object. Can someone help me out?

  • #2
    Hi dhydrated,


    I had the same question.

    You must pass the link entity, as below:


    curl -i -v -X POST \
    -H "Content-Type: application/json" \
    -d '{"code":"111", "description":"Example Description", "resource-two":"../resource-two/1"}' \
    "http://localhost:8080/api/resource-one"

    Comment

    Working...
    X