Skip to content

Couldn't use Type.BigInt in the nest Type.Object in the item of Type.Array #148

@cw1997

Description

@cw1997

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.27.0

Plugin version

No response

Node.js version

20.9.0

Operating system

Windows

Operating system version (i.e. 20.04, 11.3, 10)

10

Description

As you could see in the https://stackblitz.com/edit/stackblitz-starters-aysb1e?description=A%20simple%20starter%20for%20using%20nodemon%20printing%20no%20messages%20in%20a%20terminal&file=package.json,index.ts&title=Nodemon%20Starter

image

Link to code that reproduces the bug

No response

Expected Behavior

I could use the schema as

Type.Object({
  post: Type.Array(
    Type.Object({
      id: Type.BigInt(), // if using BigInt it will not work!
      // id: Type.Number(), // if using Number it will work!
      desc: Type.String(),
    })
  ),
}),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions