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

Stack overflow with circular references. #26

Open
pms1969 opened this issue May 17, 2022 · 2 comments
Open

Stack overflow with circular references. #26

pms1969 opened this issue May 17, 2022 · 2 comments
Assignees
Labels
bug Something isn't working OAS(swagger) OAS(swagger) module

Comments

@pms1969
Copy link

pms1969 commented May 17, 2022

Describe the bug
When trying to analyse a specific swagger.json file, cherrybomb exits with a stack overflow.

To Reproduce
Steps to reproduce the behavior:

  1. extract the zip file; the json file contained within is 129 lines long; too big to paste here sensibly but not extravagant
  2. run cherrybomb oas -f ./mvr.json
    mvr.json.zip
  3. See error;
No config file was loaded to the scan, default configuration is being used


thread 'main' has overflowed its stack
fatal runtime error: stack overflow
[1]    27024 abort      cherrybomb oas -f ./mvr.json

Expected behavior
I would expect cherrybomb to identify the circular reference and warn on it.

Desktop (please complete the following information):

  • OS: MacOS
  • Version 12.x

Additional context
The json setup of the swagger file won't make much sense. I sanitised it, and reduced what was a ~9k line file into something as small as I was willing to go without spending too much time on it. It reliably reproduces the problem I was observing.

Discussed in discord.

@GuyL99 GuyL99 added bug Something isn't working OAS(swagger) OAS(swagger) module labels Jun 23, 2022
@ThaDaVos
Copy link

ThaDaVos commented Aug 8, 2022

I am having the same issue - was looking for a OpenAPI 3 validator, found cherrybomb (which looks amazing) - but sadly it fails when the api-docs contains circular references, in my case, this is caused because we have schema's referencing each other because of two way relations stuff

@RazMag
Copy link
Collaborator

RazMag commented Aug 30, 2022

Ive added for now a specific panic for circular references. Will soon add this as a passive test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OAS(swagger) OAS(swagger) module
Projects
None yet
Development

No branches or pull requests

4 participants