Giter Site home page Giter Site logo

Comments (4)

MikeRalphson avatar MikeRalphson commented on August 18, 2024

@philsturgeon do you think this could be related to Mermade/oas-kit#78 or is it a separate issue?

from speccy.

philsturgeon avatar philsturgeon commented on August 18, 2024

Sadly not @MikeRalphson, it's only when using -j and the invalid type is in a JSON Schema file.

The json-schema-to-openapi-schema library is throwing an exception that the oas-kit filter logic is not expecting.

▶ node speccy lint test/samples/json-schema/openapi.yaml -j --verbose
GET /Users/philsturgeon/src/speccy/rules/default.json
.. snip ..
GET test/samples/json-schema/openapi.yaml
GET /Users/philsturgeon/src/speccy/test/samples/json-schema/a.json
{ Error
    at Object.<anonymous> (/Users/philsturgeon/src/speccy/node_modules/json-schema-to-openapi-schema/index.js:8:30)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/philsturgeon/src/speccy/lint.js:9:24)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
  name: 'InvalidTypeError',
  message: 'Type "foo" is not a valid type' }
ReferenceError: err is not defined
    at /Users/philsturgeon/src/speccy/node_modules/oas-resolver/index.js:215:26
ReferenceError: err is not defined
    at /Users/philsturgeon/src/speccy/node_modules/oas-resolver/index.js:215:26
err is not defined

Not sure what to do about this.

from speccy.

MikeRalphson avatar MikeRalphson commented on August 18, 2024

@philsturgeon The throwing of the undefined err (when it should be ex) is fixed in oas-resolver v1.0.10

from speccy.

philsturgeon avatar philsturgeon commented on August 18, 2024

Confirmed! Thank you so much @MikeRalphson.

$ speccy lint test/samples/json-schema/openapi.yaml -j
err is not defined
$ node speccy lint test/samples/json-schema/openapi.yaml -j
Type "foo" is not a valid type

This will be fixed by #181.

from speccy.

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.