Skip to content

Using an @ in the property key causes a syntaxerror #61

@lwestenberg

Description

@lwestenberg

Example:

https://typed-openapi-astahmer.vercel.app/?input=PYBwpgdghiCWBcACAzAOgAyuQKFhAZsPNoogC6xkA2YSAyrALYg2ICCACgJImIBuYAE4BnWMAhIAjBgzYQUMgAthxUgHpKYRit6kA5mDKrSJ4QFdGjKIICeSADKxhZRJu26TgsMJDjh34xMTAHIAJnR0YMCgkwATbwBjQVgQCnEkNghEa0EoG0RgfFcyLWEPGMQE8RKII3KK7JAWWASFMQg1ACthdPqGxGEExS0oaP6gshtwJBy8vvG3HXHxgBIvfCRggGI1KuZxSDJhNUHhq2OuEsZg7D3fCEOlgaGRp9JLrTHyKdoCgCNOmAEmR6iBBKAhBQAvNYLEvhMfkhnMkIHp5sEAALQRhgKLzUiTaYDMgovRAA

When you click on Zod, Valibot, Yup or io-ts it causes an error:


Uncaught SyntaxError: Property assignment expected. (2:27) (at index-5702c926.js:8870:22646)
  1 | z.object({
> 2 | id: z.string().optional(),@name: z.string().optional()
    |                           ^
  3 | })

The Swagger editor gives no errors on this schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions