Skip to content

How to ref a schema that was not defined by typebox? #3328

@OmarAlkadri

Description

@OmarAlkadri

How can I create a userID whose reference is the same as users

i use feathersjs V5 and typeBox

export const usersSchema = Type.Object(
{
_id: ObjectIdSchema(),
email: Type.String(),
date: Type.String({ format: 'date' }),
password: Type.Optional(Type.String()),
userID: ObjectIdSchema(),

user: Type.Ref(usersSchema),
},
{ $id: 'Users', additionalProperties: false }
)
Block-scoped variable 'usersSchema' used before its declaration.ts(2448)
users.schema.ts(13, 14): 'usersSchema' is declared here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions