Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oas-generator

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oas-generator

OAS code generator

  • 2.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

oas-generator

Build Status dependencies Status codecov Known Vulnerabilities Greenkeeper badge

NPM

This module provides NodeJS RESTfull APIs scaffolding based OpenAPI 3.x specs using oas-tools and express. It is compatible with servers generated with the swagger-tool suite to help in the transition from pre-existing servers based on 2.x specs.

We have a 2 min. tutorial:

oas-generator introduction (v2.0.6) - Click to Watch!

1. Install oas-generator

npm install oas-generator -g

2. Use oas-generator command

2.1. Help

$ oas-generator --help

Usage:  oas-generator <OAS v3 file in YAML or JSON>

  Options:

    -n, --projectName <projectName>  Name for the generated folder
    -z, --generateZip                Indicate whether the generated folder must be deleted after compression
    -h, --help                       output usage information

2.2 Examples

Generate a NodeJS project: The following command wil create the code of a NodeJS application based on the OpenAPI Spec 3.x docker-engine.yaml and place its code in a folder by the name generatedServer.

$ oas-generator specs/docker-engine.yaml -n generatedServer

Once the folder is created locate into it. Install dependencies and run it by doing npm start:

$ cd generatedServer
$ npm start

Now your app is running on port 8080. You can try the url http://localhost:8080/v1.33/volumes

In the folder controllers there will be a set of js files with the templates for each method specified in the spec that should be completed to have a fully working API.

Happy coding!

License

Copyright 2018, ISA Group, University of Sevilla

For technical inquiry please contact to engineering team.

ISA Group

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

FAQs

Package last updated on 22 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc