Comments (7)
At the point of this processing, I don't believe we have a filename to print. This code is operating on a resolvedSchema
, meaning a schema where references have already been resolved.
But there may be a clue that can help find the problem. The code that failed looks like this:
const arrayPathsToOctetSequence = [];
const arrayItems = resolvedSchema.items;
if (arrayItems !== undefined) {
// supports both array and string (delimited by .) paths
const pathToSchema = Array.isArray(path)
? path.concat('items')
: `${path}.items`;
if (arrayItems.type === 'string' && arrayItems.format === 'binary') {
The last line is the line that failed, attempting to reference type
of arrayItems
. You see just above that the code checks arrayItems !== undefined
, but does not check for null
. So this suggests that somewhere in your API doc there is an items: null
. Maybe. Worth looking for.
from openapi-validator.
I was just about to tag somebody in the PR, but I see that there is activity on this ticket. I'll hold my peace for now.
from openapi-validator.
@jorge-ibm was @mkistler going to work on this? If not, @distortedsignal, we would welcome the PR!
from openapi-validator.
Yes I think @mkistler was going to take a look, but I agree. @distortedsignal if you have a PR for this already please feel free to submit it
from openapi-validator.
I sent a PR to add the path to the exception text. I figure the best way to report to the user that their OpenAPI spec is not valid is to point them to where the invalid spec is. Check out the PR here: #190
from openapi-validator.
Resolved in #190
@distortedsignal Let me know if that PR doesn't fully resolve the issue. Thanks for the PR!
from openapi-validator.
I think the PR resolves the issue enough. It will at least tell you where the data types are that are causing the issue. This is as much as can be asked for when dealing with faulty API documentation.
from openapi-validator.
Related Issues (20)
- 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 4
- ibm-parameter-description rule should skip responses.links.{name}.parameters HOT 3
- Runtime error for SCIM-compliant schema (object containing $ref attribute) HOT 4
- Fix test failures with Node 20 HOT 3
- BUG: 'Enum values must be snake case' on enums like '400', '500' HOT 4
- Error running lint-openapi since v1.18.1 HOT 4
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.