Comments (8)
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.
Ok, I got permission from my boss to ship this code if all the fields were md5'ed. So here we go.
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.
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.
hey @distortedsignal - are you still having issues with this?
from openapi-validator.
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.
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.
@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.
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)
- Loadash warning HOT 4
- Text output version not printing error rule HOT 1
- collections missing from the openapi-ruleset in version 0.45.3 HOT 5
- Outdated info in ruleset doc HOT 5
- Support for authenticated additional Openapi definitions HOT 1
- missing-required-property rule failed at anyOf required options HOT 1
- v1.0 Community Feedback HOT 3
- Error when I use a customized rule HOT 7
- feature request: Find a way to extend the spectral default ruleset without installing it local HOT 1
- A dependency of this repository contains a critical VM escape vulnerability HOT 5
- Incorrect validation results for the ibm-parameter-casing-convention rule with camelCase HOT 3
- Support Request: how can a rule ignore parameters with a specific name? HOT 3
- ibm-etag-header crashes linter on incorrect specification HOT 4
- Failed to resolve entry for package "ibm-openapi-validator HOT 2
- Rule "ibm-success-response-example" fails for some operations but not others HOT 3
- support for RPC style HTTP calls HOT 4
- Update documentation to reflect latest recommendations HOT 1
- ibm-parameter-description rule should skip responses.links.{name}.parameters HOT 3
- Runtime error for SCIM-compliant schema (object containing $ref attribute)
- Fix test failures with Node 20 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi-validator.