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

Importing OpenApi document fails - Range Error #939

Closed
AuTrevor opened this issue Nov 9, 2023 · 5 comments
Closed

Importing OpenApi document fails - Range Error #939

AuTrevor opened this issue Nov 9, 2023 · 5 comments

Comments

@AuTrevor
Copy link

AuTrevor commented Nov 9, 2023

What I was trying to do

Import a 1600 line published openAPI document into Bruno

What was supposed to happen

OpenAPI was imported successfully

What happened

UI threw and error saying: Import collection failed. An error occurred while parsing the openAPI collection. Both importing as JSON and converting to YAML and attempting to import run into similar errors.

Additional information

Opening the console, the following error is shown:

BrunoError: An error occurred while parsing the OpenAPI collection
at 772-5e0c4231fc48a067.js:1:25651
at new Promise ()
at ie (772-5e0c4231fc48a067.js:1:24060)
(anonymous) @ 772-5e0c4231fc48a067.js:1
Promise.catch (async)
(anonymous) @ 772-5e0c4231fc48a067.js:1
se @ 772-5e0c4231fc48a067.js:1
onClick @ 772-5e0c4231fc48a067.js:1
Oe @ framework-49f1e091cbf6b261.js:1
Ae @ framework-49f1e091cbf6b261.js:1
(anonymous) @ framework-49f1e091cbf6b261.js:1
Ir @ framework-49f1e091cbf6b261.js:1
Ur @ framework-49f1e091cbf6b261.js:1
(anonymous) @ framework-49f1e091cbf6b261.js:1
ss @ framework-49f1e091cbf6b261.js:1
Le @ framework-49f1e091cbf6b261.js:1
Hr @ framework-49f1e091cbf6b261.js:1
Kn @ framework-49f1e091cbf6b261.js:1
Qn @ framework-49f1e091cbf6b261.js:1

772-5e0c4231fc48a067.js:1 RangeError: Maximum call stack size exceeded
at String.startsWith ()
at e (772-5e0c4231fc48a067.js:1:23724)
at e (772-5e0c4231fc48a067.js:1:23950)
at e (772-5e0c4231fc48a067.js:1:23950)
at e (772-5e0c4231fc48a067.js:1:23950)
at e (772-5e0c4231fc48a067.js:1:23950)
at e (772-5e0c4231fc48a067.js:1:23950)
at e (772-5e0c4231fc48a067.js:1:23922)
at e (772-5e0c4231fc48a067.js:1:23950)
at e (772-5e0c4231fc48a067.js:1:23950)

I've validated the OpenAPI spec on the https://editor.swagger.io/.

OpenAPI spec that causes the issue is published here:
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-09-01-preview/inference.json

Art051 added a commit to Art051/bruno that referenced this issue Nov 14, 2023
…omponents, resulting in infinite loops being made within resolveRefs.

Solution: Added basic use of Set to store already-traversed items within the OpenAPI spec.
Linked to personal use having import problems as well as this issue raised: usebruno#939 (comment)

Tested against the API Spec mentioned in the issue both as JSON and YAML.
@sanjai0py
Copy link
Member

Closing this issue as it could not be recreated in the latest version of Bruno v1.20.0

Screen.Recording.2024-07-02.at.3.34.18.PM.mov

@tlund101
Copy link

tlund101 commented Oct 25, 2024

Still seeing this issue when importing Jira's OpenAPI spec: https://dac-static.atlassian.com/cloud/jira/platform/swagger-v3.v3.json?_v=1.7513.0-0.1310.0

I'm running Bruno v1.31.0

Slightly different stack trace here though:

RangeError: Maximum call stack size exceeded
    at resolveRefs (871-7fa6c933a094f6be.js:1:24965)
    at resolveRefs (871-7fa6c933a094f6be.js:1:26496)
    at resolveRefs (871-7fa6c933a094f6be.js:1:26496)
    at resolveRefs (871-7fa6c933a094f6be.js:1:26496)
    at 871-7fa6c933a094f6be.js:1:25210
    at Array.map (<anonymous>)
    at resolveRefs (871-7fa6c933a094f6be.js:1:25187)
    at resolveRefs (871-7fa6c933a094f6be.js:1:26496)
    at resolveRefs (871-7fa6c933a094f6be.js:1:26496)
    at resolveRefs (871-7fa6c933a094f6be.js:1:26496)
BrunoError: An error occurred while parsing the OpenAPI collection
    at 871-7fa6c933a094f6be.js:1:28585
    at new Promise (<anonymous>)
    at parseOpenApiCollection (871-7fa6c933a094f6be.js:1:27548)

@pranavburnwal
Copy link

Still seeing this issue when importing Jira's OpenAPI spec: dac-static.atlassian.com/cloud/jira/platform/swagger-v3.v3.json?_v=1.7513.0-0.1310.0

I'm running Bruno v1.31.0

Slightly different stack trace here though:

RangeError: Maximum call stack size exceeded
    at resolveRefs (871-7fa6c933a094f6be.js:1:24965)
    at resolveRefs (871-7fa6c933a094f6be.js:1:26496)
    at resolveRefs (871-7fa6c933a094f6be.js:1:26496)
    at resolveRefs (871-7fa6c933a094f6be.js:1:26496)
    at 871-7fa6c933a094f6be.js:1:25210
    at Array.map (<anonymous>)
    at resolveRefs (871-7fa6c933a094f6be.js:1:25187)
    at resolveRefs (871-7fa6c933a094f6be.js:1:26496)
    at resolveRefs (871-7fa6c933a094f6be.js:1:26496)
    at resolveRefs (871-7fa6c933a094f6be.js:1:26496)
BrunoError: An error occurred while parsing the OpenAPI collection
    at 871-7fa6c933a094f6be.js:1:28585
    at new Promise (<anonymous>)
    at parseOpenApiCollection (871-7fa6c933a094f6be.js:1:27548)

+1

@talkingjd72
Copy link

I am running into this issue as well with this openAPI v3 api import.
folio-api-json.json

@gskornowicz
Copy link

The same issue.
Trying to import this https://github.com/cloudflare/api-schemas/blob/main/openapi.json
and receive
Import collection failed: An error occurred while parsing the OpenAPI collection

v1.38.1 installed via choco on win10

electron | : 33.2.1
chrome | : 130.0.6723.137
node | : 20.18.1
v8 | : 13.0.245.19-electron.0

Stack from console

index.1962d89a.js:4 RangeError: Maximum call stack size exceeded
    at new Set (<anonymous>)
    at iS (index.1962d89a.js:4:8484)
    at iS (index.1962d89a.js:4:8474)
    at iS (index.1962d89a.js:4:8474)
    at iS (index.1962d89a.js:4:8474)
    at iS (index.1962d89a.js:4:8474)
    at iS (index.1962d89a.js:4:8474)
    at iS (index.1962d89a.js:4:8474)
    at iS (index.1962d89a.js:4:8474)
    at iS (index.1962d89a.js:4:8474)
(anonymous) @ index.1962d89a.js:4
iU @ index.1962d89a.js:4
Promise.then
(anonymous) @ index.1962d89a.js:4
iT @ index.1962d89a.js:4
s @ index.1962d89a.js:4
uU @ lib-react.41929aa2.js:2
(anonymous) @ lib-react.41929aa2.js:2
tC @ lib-react.41929aa2.js:2
uW @ lib-react.41929aa2.js:2
sK @ lib-react.41929aa2.js:2
sQ @ lib-react.41929aa2.js:2
index.1962d89a.js:4 BrunoError: An error occurred while parsing the OpenAPI collection
    at index.1962d89a.js:4:10282
    at new Promise (<anonymous>)
    at iU (index.1962d89a.js:4:9308)
(anonymous) @ index.1962d89a.js:4
Promise.catch
(anonymous) @ index.1962d89a.js:4
iT @ index.1962d89a.js:4
s @ index.1962d89a.js:4
uU @ lib-react.41929aa2.js:2
(anonymous) @ lib-react.41929aa2.js:2
tC @ lib-react.41929aa2.js:2
uW @ lib-react.41929aa2.js:2
sK @ lib-react.41929aa2.js:2
sQ @ lib-react.41929aa2.js:2

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

6 participants