Skip to content

Resolvers: default option breaks codegen for big numbers #3365

@matthew-salerno

Description

@matthew-salerno

Description

First mention in #3132. Given the following valibot resolver:

{
  name: 'valibot',
  '~resolvers': {
    number(ctx) {
      const { $, plugin, symbols, schema } = ctx;
      const { v } = symbols;
      const big = plugin.symbolOnce('Big', {
        external: 'big.js',
        importKind: 'named',
      });
      return $(v).attr('instance').call(big);
    },
  },
},

There is no way to handle the behavior of default numbers, leading to improper codegen like this:

Image

I am unsure if Zod has the same issue.

Reproducible example or configuration

https://stackblitz.com/edit/ttamttam-hey-api-default-resolvers

OpenAPI specification (optional)

No response

System information (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🔥Broken or incorrect behavior.important 📌This issue is important and will be addressed when capacity allows.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions