klaviyo-api-node icon indicating copy to clipboard operation
klaviyo-api-node copied to clipboard

Relationship(s) Field Not an Array

Open TheDunco opened this issue 2 years ago • 3 comments

It's interesting to me that the relationships field in endpionts like subscribe profiles is "relationships" instead of just relationship because that field is NOT an array so it shouldn't be plural.

It would be fantastic if we could actually provide multiple relationships in this request in the form of an array of relationship objects. If that's not possible, I'd like to see the field here renamed or aliased to relationship for clarity.

TheDunco avatar Sep 27 '23 20:09 TheDunco

I see why it is confusing to have plural name relationships in this case when it is possible to provide reference to only one list. The reason we used plural name here and everywhere in our API was to be compliant with JsonAPI specification. Please find more details about format for relationships Json API - creating resources.

Also, if we decided to deviate from the specification, renamed the field to relationship and later decided to support additional relationship (e.g. tag) for this endpoint we would need to rename the field back to relationships. That would be a breaking change.

vpylypenko-klaviyo avatar Sep 28 '23 20:09 vpylypenko-klaviyo

to be compliant with JsonAPI specification

Ah, I see, that makes sense. My gripe lies with the JsonAPI specification then! 🤣

The request I have for the Klaviyo team would then be to either add a callout in the documentation that this field is NOT an array, and/or add a section about best practices for adding multiple relationships so more me's don't pop up confused about this 😆

TheDunco avatar Sep 28 '23 20:09 TheDunco

Also, I agree that the least amount of breaking API changes is the best experience for everyone!

TheDunco avatar Sep 28 '23 20:09 TheDunco