orbitjs / orbit

Composable data framework for ambitious web applications.
https://orbitjs.com
MIT License
2.33k stars 133 forks source link

Possible bug in related record validation? #845

Closed SafaAlfulaij closed 3 years ago

SafaAlfulaij commented 3 years ago

I'm not sure anymore, but it seems that this might a bug in validation, as it takes the type (hasOne/hasMany) rather than the kind (actual resource name).

https://github.com/orbitjs/orbit/blob/1bcbe72a3083545efec06150b39549472829a7c5/packages/%40orbit/records/src/record-validators/related-record-validator.ts#L119-L121

dgeb commented 3 years ago

I really need to finish updating the v0.17 docs. We've deprecated using type to define hasOne / hasMany, instead using kind. And type is the model type now, to be consistent with other usages of type. There should be a deprecation warning emitted about this (if not, please let me know). Sorry for the confusion.

SafaAlfulaij commented 3 years ago

You guessed correct, kind and type were swapped.