feathers
feathers copied to clipboard
Recursive schemas not working or not possible
Steps to reproduce
Start with the feathers-chat example and try to add replies to messages from there.
Expected behavior
One would expect to be able to change the messageSchema const at feathers-chat-ts/src/services/messages/messages.schema.ts:9 to Type.Recursive with its parameter being an arrow function that returns the original Type.Object call with an added line inside this object that looks like parent: Type.Optional(Type.Ref(_messageSchema)), add an optional parentId to the schema and that would be the end of it.
Actual behavior
When messageSchema is a Type.Recursive instead of a Type.Object it causes several TypeScript errors and fails to compile.
System configuration
I'm using the latest versions of FeathersJS, NodeJS, and Ubuntu Server.