npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

oas-path-generator

v1.1.0

Published

If you are as [lazy](http://threevirtues.com/) as me, you would have often wondered if there was an easier way to draft your OpenApi specs using just the schemas or at least get a starting boiler plate code for the paths definitions based on some template

Downloads

10

Readme

oas-path-generator

If you are as lazy as me, you would have often wondered if there was an easier way to draft your OpenApi specs using just the schemas or at least get a starting boiler plate code for the paths definitions based on some template.

If so then today is your lucky day. Here is a tool that lets you do just that. Use this tool to generate Open API v3.0 paths using the schema objects with vendor extensions defined in the usage section.

Getting Started

Pre-requisites

  • Install Node JS
  • download oas-repo and build or use npm
  • download this source code or use npm

Usage

npm install oas-path-generator --save

In your schema models add the following:

x-path-gen:
  operations:
    - list
    - create
    //all actions you want your path to have
  pluralName: models //optionally specify the name for the path.
  //If not present the plural form of the model name is generated automatically

run the following script to generate

npm start [modelFileName]

you can also use the realtime editor by running

npm run editor

Then open http://localhost:8080/swagger-editor/ in Chrome and you will get a Swagger Editor that you can use to define your models

Once edited , refresh the editor browser and voila your paths have been created for you to further modify.

Notes

  • Once path is created, changes in model does not reflect till the path is deleted from the editor.
  • If you delete all the paths in the editor, then you will need to clear the browser cache for the changes to take effect.
  • Tip! Instead of deleting all paths leave one and refresh and then delete the one that was left out and refresh again

OpenAPI Specification for the vendor extension created here

see spec_backup.yaml or do npm run editor

Tests

Run the tests by npm test

Github Pages

Deploys docs to GitHub Pages. You don't need to run it manually if you have Travis CI configured. npm run gh-pages