feathers icon indicating copy to clipboard operation
feathers copied to clipboard

Recursive schemas not working or not possible

Open SeanMXD opened this issue 2 years ago • 0 comments

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.

SeanMXD avatar Apr 24 '23 02:04 SeanMXD