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

[BUG]: JSON syntax error in version 17.0.0 #473

Open
1 task done
ezzatron opened this issue Nov 21, 2024 · 2 comments
Open
1 task done

[BUG]: JSON syntax error in version 17.0.0 #473

ezzatron opened this issue Nov 21, 2024 · 2 comments
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@ezzatron
Copy link

What happened?

Importing version 17.0.0 of this module produces a JSON syntax error:

undefined:63777
          "422": {
               ^

SyntaxError: /path/to/project/node_modules/@octokit/openapi/generated/api.github.com.deref.json: Expected ',' or ']' after array element in JSON at position 3097449
    at parse (<anonymous>)
    at Module._extensions..json (node:internal/modules/cjs/loader:1566:39)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/path/to/project/node_modules/@octokit/openapi/index.js:3:31)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)

Node.js v20.18.0

Looking into the source of generated/api.github.com.deref.json on line 63777 you can see that it's not valid JSON. There's an array, but it seems like something is trying to add in object properties:

{
  "paths": {
    "/orgs/{org}/codespaces/secrets/{secret_name}": {
      "get": {
        "summary": "Get an organization secret",
        "description": "Gets an organization development environment secret without revealing its encrypted value.\n\nOAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.",
        "tags": [
          "codespaces"
        ],
        "operationId": "codespaces/get-org-secret",
        "externalDocs": {
          "description": "API method documentation",
          "url": "https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret"
        },
        "parameters": [
          {
            "name": "org",
            "description": "The organization name. The name is not case sensitive.",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          "422": {
            "description": "Validation failed, or the endpoint has been spammed.",
            "content": {

Versions

  • @octokit/openapi@17.0.0
  • Node.js v20.18.0

Relevant log output

$ node -e 'require("@octokit/openapi");'
node:internal/modules/cjs/loader:1569
    throw err;
    ^

SyntaxError: /path/to/project/node_modules/@octokit/openapi/generated/api.github.com.deref.json: Expected ',' or ']' after array element in JSON at position 3097449
    at parse (<anonymous>)
    at Module._extensions..json (node:internal/modules/cjs/loader:1566:39)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/path/to/project/node_modules/@octokit/openapi/index.js:3:31)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)

Node.js v20.18.0

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ezzatron ezzatron added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Nov 21, 2024
Copy link
Contributor

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@ezzatron
Copy link
Author

Any chance someone could take a look at this? It's been broken for weeks now.

@nickfloyd nickfloyd moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

1 participant