Skip to content

ReferenceError: Buffer is not defined #3042

@GeoMH

Description

@GeoMH

Q&A (please complete the following information)

  • OS: Windows 10
  • Browser: Mozilla Firefox
  • Version: 99.0.1 (64-Bit)
  • Method of installation: copied the files of the web application into the web application directory of my webserver
  • Swagger-Editor version: 4.2.3 (and 4.2.2 for comparison)
  • Swagger/OpenAPI version: 3.0.1

Content & configuration

Example Swagger/OpenAPI definition:

openapi: 3.0.1
info:
  title: Test API
  version: 0.1.0
paths:
  /function1:
    get:
      tags:
        - function1
      summary: always working
      operationId: function1
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                properties:
                  version:
                    type: string
  /function2:
    get:
      tags:
        - function2
      summary: not working when authorised and using swagger editor 4.2.3 or newer
      operationId: function2
      security:
        - basicAuth: []
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                properties:
                  token:
                    type: string
        '401':
          description: Unauthorized
          content: {}
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
servers:
  - url: http://localhost
    variables: {}

Describe the bug you're encountering

To reproduce...

Steps to reproduce the behavior:

  1. Go to the swagger editor in the version 4.2.3 on a local webserver. Parallel to that do the exact same with a swagger editor in the version 4.2.2 on the exact same local webserver.
  2. Copy and paste the yaml from this message into the left sidebar.
  3. Click on "Authorize" on the rigth side and enter a username and a password (It doesn't matter what you enter and if this even exists. Just enter something.).
  4. Execute the functions from the yaml.
  5. In the version 4.2.2 when executing "funtion1" and "function2" everything works very well (you only get a 404 because there is obvoiusly nothing to return in that case). In the version 4.2.3 "function1" also works good and "function2" when not authorised but when authorized the execution of "function2" will take forever (See "Screenshot 1" and "Screenshot 3").

Expected behavior

In every other case everything works very well (see "Screenshot 2") (Don't be confused by the 404. This is okay in that case. It only matters if the function was executed.).

Screenshots

Screenshot 1:
image

Screenshot 2:
image

Screenshot 3:
image

Additional context or thoughts

In encountered this issue while working on a web project. Since a couple of days a can't execute some of my functions in it anymore using "editor.swagger.io" which worked before without any problems. Later I got the idea to try execute the same functions in my project with an older version of the swagger-editor and recognized that the issue seems to be something between the 4.2.2 and the 4.2.3.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions