vercel / vercel/sdk

`projects[].security.managedRules.traffic_sources` Expected array, received object

Open Beginner friendly
#322 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
160
Forks
42
Avg merge
19h 36m
Merged PRs (30d)
16

Description

Using 1.28.6 I get this error when calling getProjects.

  [
    {
      "code": "invalid_union",
      "unionErrors": [
        {
          "issues": [
            {
              "code": "invalid_union",
              "unionErrors": [
                {
                  "issues": [
                    {
                      "code": "invalid_type",
                      "expected": "null",
                      "received": "object",
                      "path": [
                        "projects",
                        9,
                        "security"
                      ],
                      "message": "Expected null, received object"
                    }
                  ],
                  "name": "ZodError"
                },
                {
                  "issues": [
                    {
                      "code": "invalid_type",
                      "expected": "object",
                      "received": "undefined",
                      "path": [
                        "projects",
                        9,
                        "security",
                        "managedRules",
                        "traffic_sources"
                      ],
                      "message": "Required"
                    }
                  ],
                  "name": "ZodError"
                }
              ],
              "path": [
                "projects",
                9,
                "security"
              ],
              "message": "Invalid input"
            }
          ],
          "name": "ZodError"
        },
        {
          "issues": [
            {
              "code": "invalid_union",
              "unionErrors": [
                {
                  "issues": [
                    {
                      "code": "invalid_type",
                      "expected": "null",
                      "received": "object",
                      "path": [
                        "projects",
                        9,
                        "security"
                      ],
                      "message": "Expected null, received object"
                    }
                  ],
                  "name": "ZodError"
                },
                {
                  "issues": [
                    {
                      "code": "invalid_type",
                      "expected": "object",
                      "received": "undefined",
                      "path": [
                        "projects",
                        9,
                        "security",
                        "managedRules",
                        "traffic_sources"
                      ],
                      "message": "Required"
                    }
                  ],
                  "name": "ZodError"
                }
              ],
              "path": [
                "projects",
                9,
                "security"
              ],
              "message": "Invalid input"
            }
          ],
          "name": "ZodError"
        },
        {
          "issues": [
            {
              "code": "invalid_type",
              "expected": "array",
              "received": "object",
              "path": [],
              "message": "Expected array, received object"
            }
          ],
          "name": "ZodError"
        }
      ],
      "path": [],
      "message": "Invalid input"
    }
  ]

EDIT: I removed references to #206 the new error isn't exactly the same

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the getProjects entry point and locate the schema for projects[].security.managedRules.traffic_sources. Compare that schema with the object returned by the Vercel API, then verify that getProjects accepts the reported response and add or update coverage if the repository provides a relevant test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.