BlairAllegroTech / js-data-jsonapi

JsonApi Adapter for js-data
MIT License
15 stars 5 forks source link

Mixed case Relationship and Type Names should be processed correctly #43

Closed BlairAllegroTech closed 7 years ago

BlairAllegroTech commented 7 years ago

This relates to #41,

There is also an issue with case sensitive names. This is something that I've been thinking about. In all of my tests i have used lower case type names and then made case insensitive comparisons on the resource Urls. This was so that Urls did not have to be strictly lower case. However when you introduce js-data type names with upper characters this no longer works. I think i should change this so that we perform case sensitive comparison, e.g. when searching for js-data relationships and fall back to case insensitive if not found, and possibly allow this behavior to be turned off also

Change code so that js-data types and relationships are compared using case sensitive comparisons. If this fails it falls back to checking lower case names.

BlairAllegroTech commented 7 years ago

Note : when non-java compliant characters are used as js-data type names, js-data removes these characters so to form a java script variable name.

In this case js-data also creates an endpoint for the resource that matches exactly the jsonapi type name. I have not altered this behavior at all and seem to work well here.