api icon indicating copy to clipboard operation
api copied to clipboard

Weird error when installing an SDK

Open erunion opened this issue 1 year ago • 2 comments

npx api@beta install @readme-nyc/v1.0#17681m2il63r8rns
screen_shot_2022-07-27_at_2 20 36_pm

erunion avatar Jul 27 '22 18:07 erunion

@kanadgupta I can't replicate this. 😞

Screen Shot 2022-07-30 at 4 34 40 PM

Can you still get this error to pop up?

erunion avatar Jul 30 '22 23:07 erunion

Ah so it errors out if there's an existing openapi.json in the directory. Here's the command sequence I ran:

image

And here's a dump the OpenAPI file in the directory (named openapi.json):

{
  "openapi": "3.0.0",
  "info": {
    "title": "Endpoints",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://readme.nyc/api"
    }
  ],
  "paths": {
    "/message": {
      "get": {
        "summary": "Get the current message",
        "description": "This will return the current message",
        "tags": [
          "Messages"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "post": {
        "summary": "Update the sign message",
        "description": "This will send a message to the Vestaboard to be displayed",
        "requestBody": {
          "description": "Optional description in *Markdown*",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text",
                  "color"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "What text should be displayed?"
                  },
                  "color": {
                    "type": "string",
                    "enum": [
                      "red",
                      "orange",
                      "yellow",
                      "green",
                      "blue",
                      "violet"
                    ]
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Messages"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      },
      "delete": {
        "summary": "Reset sign message",
        "description": "This will reset the Vestaboard's message",
        "tags": [
          "Messages"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    },
    "/owlfact": {
      "get": {
        "summary": "Owl facts",
        "description": "Get a random, possibly true, owl fact",
        "tags": [
          "Fun Facts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Messages",
      "description": "Interact with the Vestaboard"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  }
}

kanadgupta avatar Aug 01 '22 17:08 kanadgupta

I've not been able to replicate this, and we've not gotten any other reports about it, so I'm closing it out.

erunion avatar Oct 19 '23 07:10 erunion