Giter Site home page Giter Site logo

Comments (7)

mkistler avatar mkistler commented on September 26, 2024

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.

distortedsignal avatar distortedsignal commented on September 26, 2024

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.

dpopp07 avatar dpopp07 commented on September 26, 2024

@jorge-ibm was @mkistler going to work on this? If not, @distortedsignal, we would welcome the PR!

from openapi-validator.

jorge-ibm avatar jorge-ibm commented on September 26, 2024

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.

distortedsignal avatar distortedsignal commented on September 26, 2024

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.

dpopp07 avatar dpopp07 commented on September 26, 2024

Resolved in #190

@distortedsignal Let me know if that PR doesn't fully resolve the issue. Thanks for the PR!

from openapi-validator.

distortedsignal avatar distortedsignal commented on September 26, 2024

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)

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.