Giter Club home page Giter Club logo

openapi-checker's Introduction

openapi-checker

Checks structural and semantic errors in OPENAPI files (json and yaml) by posting passed files to https://validator.swagger.io/.

Usage


  • Run npm install -g openapi-checker
  • Run openapi-checker /path/to/file to validate your OPENAPI file.

openapi-checker's People

Contributors

fenn-cs avatar

Watchers

 avatar  avatar  avatar

openapi-checker's Issues

YAML doesn't seem to be supported, despite claim in README

Like it says on the tin. Here's the command I'm running and its output:

 npx openapi-checker ./design/openapi.yaml
undefined:1
openapi: 3.0.0
^

SyntaxError: Unexpected token o in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.<anonymous> (/Users/yanni/.npm/_npx/f82504eb25360710/node_modules/openapi-checker/validator.js:16:24)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

The YAML file opens with openapi: 3.0.0, which is certainly not a JSON data structure (so the error is "accurate")… and, looking at the validate.js file, I'm puzzled as to where it's even possible that YAML is at all supported by this package. Perhaps an unpushed / unmerged branch somewhere…? 😅

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.