Enforcing a Relationship when creating a Child Resource

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.

You can use compound documents to create them together.

1 Like

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


This PR resolves your case.

1 Like

Thanks for sharing the PR.