Skip to content

merged schema cache is messed up #676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
climba03003 opened this issue Feb 1, 2024 · 2 comments · Fixed by #677
Closed
2 tasks done

merged schema cache is messed up #676

climba03003 opened this issue Feb 1, 2024 · 2 comments · Fixed by #677

Comments

@climba03003
Copy link
Member

climba03003 commented Feb 1, 2024

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.x

Plugin version

5.11.0

Node.js version

20.x

Operating system

Windows

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

11

Description

I suspect it is deal to the merged schema cache is not properly handled, which means two seperate build procedure may try to use the same cache but it never exists.

Steps to Reproduce

import { build } from 'fast-json-stringify'

const schema = {
  type: 'object',
  properties: {
    enums: {
      type: 'string',
      anyOf: [
        { type: 'string', const: 'FOO' },
        { type: 'string', const: 'BAR' },
        { type: 'string', const: 'BAZ' },
      ]
    }
  }
}

build(schema, {
  schema: {}
})

build(schema, {
  schema: {}
})

Expected Behavior

No response

@climba03003
Copy link
Member Author

cc @ivan-tymoshenko

@ivan-tymoshenko
Copy link
Member

@climba03003 yeap the problem is with attaching a symbol property to the schema. I will fix it soon. The release is reverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants