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.