Skip to content
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

Possible BUG: Set of string URLs fails #3963

Open
patrickReiis opened this issue Jan 30, 2025 · 0 comments
Open

Possible BUG: Set of string URLs fails #3963

patrickReiis opened this issue Jan 30, 2025 · 0 comments

Comments

@patrickReiis
Copy link

This code:

z.set(z.string().url()).parse(new Set('https://mint.coinos.io'))

Is failing, however, in theory it should be correct, since the schema is "Set of URLs".

Error message:

Uncaught ZodError: [
  {
    "validation": "url",
    "code": "invalid_string",
    "message": "Invalid url",
    "path": [
      0
    ]
  },
  {
    "validation": "url",
    "code": "invalid_string",
    "message": "Invalid url",
    "path": [
      1
    ]
  },
  {
    "validation": "url",
    "code": "invalid_string",
    "message": "Invalid url",
    "path": [
      2
    ]
  },
  {
    "validation": "url",
    "code": "invalid_string",
    "message": "Invalid url",
    "path": [
      3
    ]
  },
  {
    "validation": "url",
    "code": "invalid_string",
    "message": "Invalid url",
    "path": [
      4
    ]
  },
  {
    "validation": "url",
    "code": "invalid_string",
    "message": "Invalid url",
    "path": [
      5
    ]
  },
  {
    "validation": "url",
    "code": "invalid_string",
    "message": "Invalid url",
    "path": [
      6
    ]
  },
  {
    "validation": "url",
    "code": "invalid_string",
    "message": "Invalid url",
    "path": [
      7
    ]
  },
  {
    "validation": "url",
    "code": "invalid_string",
    "message": "Invalid url",
    "path": [
      8
    ]
  },
  {
    "validation": "url",
    "code": "invalid_string",
    "message": "Invalid url",
    "path": [
      9
    ]
  },
  {
    "validation": "url",
    "code": "invalid_string",
    "message": "Invalid url",
    "path": [
      10
    ]
  },
  {
    "validation": "url",
    "code": "invalid_string",
    "message": "Invalid url",
    "path": [
      11
    ]
  }
]
    at Object.get error (file:///home/me/.cache/deno/npm/registry.npmjs.org/zod/3.23.8/lib/index.mjs:587:31)
    at ZodSet.parse (file:///home/me/.cache/deno/npm/registry.npmjs.org/zod/3.23.8/lib/index.mjs:692:22)
    at <anonymous>:1:46

alexgleason pushed a commit to soapbox-pub/ditto that referenced this issue Jan 30, 2025
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

No branches or pull requests

1 participant