Enforcing a Relationship when creating a Child Resource


#1

Forgive me for the poorly-worded subject. But I have business logic that stipulates a child resource can not be created independent of its parent resource. I interpret this to mean when creating the child resource the supplied parameters MUST contain a valid relationship definition.

I’m assuming, as the writer of the server code, I need to enforce this business rule.

My Questions:

  • Does this go against the specification?
  • Is 400 Bad Request, with proper details of course, an adequate response?

Thank you.


#2

You can use compound documents to create them together.


#3

Thank you for the feedback. I will explore compound documents more closely.


#4


This PR resolves your case.


#5

Thanks for sharing the PR.