Giter Site home page Giter Site logo

Comments (8)

distortedsignal avatar distortedsignal commented on June 24, 2024 1

They're in a proprietary codebase - let me ask my boss if I can ship the full files. If I can't, I'll try to provide a redacted version of the files.

from openapi-validator.

distortedsignal avatar distortedsignal commented on June 24, 2024 1

Ok, I got permission from my boss to ship this code if all the fields were md5'ed. So here we go.

output_dir.tar.gz

My procedure here:

Unzip the tar'ed up dir:

/tmp > tar zxvf output_dir.tar.gz
x test_dir/a83fcef9ace0d75bab9602394f365f26.json
x test_dir/bad_second_half.json
/tmp > ls
...      output_dir.tar.gz            test_dir ...
/tmp > ls test_dir
a83fcef9ace0d75bab9602394f365f26.json bad_second_half.json

cd into the newly created test_dir and look around.

/tmp > cd test_dir
/tmp/test_dir > ls -laht
total 16
drwxr-xr-x   4 tom   wheel   128B Oct  8 13:07 .
drwxrwxrwt  15 root  wheel   480B Oct  8 13:07 ..
-rw-r--r--   1 tom   wheel   1.6K Oct  8 13:04 bad_second_half.json
-rw-r--r--   1 tom   wheel   1.5K Oct  8 13:04 a83fcef9ace0d75bab9602394f365f26.json

init a new openapi environment

/tmp/test_dir > lint-openapi init

[Success] '.validaterc' file created and set to defaults.

Run the linter.

/tmp/test_dir > lint-openapi bad_second_half.json

[Error] There is a problem with the Swagger.
Maximum call stack size exceeded

Interestingly, we don't hit the recursion limit if I just lint the a83fcef9ace0d75bab9602394f365f26.json file.

/tmp/test_dir > lint-openapi a83fcef9ace0d75bab9602394f365f26.json

errors

  Message :   `info` object must have a string-type `title` field
  Path    :   info.title
  Line    :   4
...

I tried to make this as minimal and readable as possible. If you would like clarification on anything, please feel free to ask.

I'm guessing there was a recursive call that was checked if everything was in one file but not if things were spread across files?

from openapi-validator.

mkistler avatar mkistler commented on June 24, 2024

It looks like the error is in performing a regex on a URL, probably from a $ref (since the bottom of the stack is json-schema-ref-parser. So my guess is that you have a $ref somewhere in your doc that causes the regex engine to run off the rails. On that theory, I'd start by just examining all the $refs in the doc to see if any looked "strange". Or perhaps you can trap at the point of the failure to see what the value is that regex is failing on.

from openapi-validator.

jorge-ibm avatar jorge-ibm commented on June 24, 2024

hey @distortedsignal - are you still having issues with this?

from openapi-validator.

distortedsignal avatar distortedsignal commented on June 24, 2024

Yeah - here's a recent run of the openapi linter to prove it:

docs > lint-openapi root_openapi_files_*.json

...

    Validation Results for root_openapi_files_one.json:

[Error] There is a problem with the Swagger.
Maximum call stack size exceeded


    Validation Results for root_openapi_files_two.json:

[Error] There was a problem with a validator.
Cannot read property 'type' of null

docs > lint-openapi --version
0.30.1

I think there is an infinite recursion in the openapi docs (something like "resource1 contains a resource1"), but I would prefer to have the linter tell me where it is, as opposed to having to hunt through the docs by hand. I think that's probably how this issue should be read?

from openapi-validator.

jorge-ibm avatar jorge-ibm commented on June 24, 2024

thanks for clarifying @distortedsignal. Can you maybe provide the api definition files you encountered this issue in?

Edit: Or if you're hesitant to provide the api definition files, either way, we'll take a look at this in the near future just wanted to see if this was still a problem.

from openapi-validator.

dpopp07 avatar dpopp07 commented on June 24, 2024

@distortedsignal There is code in the linter to recognize circular references, report them, and continue without crashing. Perhaps you have a special case that breaks that code but I am guessing that this is something else. Any API definition you provide for us to reproduce the problem, even if heavily reduced or redacted, would be appreciated. If you need to send something to one of our emails, rather than posting on a public issue, that would be fine too.

from openapi-validator.

distortedsignal avatar distortedsignal commented on June 24, 2024

Thanks @dpopp07 - I've contacted people who can make a decision on this and I'll get back to you when I have their decision.

from openapi-validator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.