Resolving conflicts between attributes and relationships in JsonApiSerializer
14:54 03 Nov 2025

I'm working on making a C# program that will integrate with Planning Center's -compliant API (docs can be found here.) For (de)serialization purposes, I'm using the JsonApiSerializer library, which is one of the recommended options in JSON:API's documentation.

Unfortunately, I've run into a slight problem: Planning Center's "Person" entity includes both an attribute named "gender" and a relationship named "gender". Thus:

  • when I define a field for one, Newtonsoft (which is what JsonApiSerializer uses under the hood) panics because it can't process the other;
  • when I try to define fields for both, it panics because there are multiple properties with the same name.

How do I resolve this? Ideally I would like to ignore the gender relationship and just use the attribute.

c# json-api