No release in over 3 years
Low commit activity in last 3 years
There's a lot of open issues
OpenAPI Specification renderer.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 13.0
~> 3.8
~> 0.86

Runtime

~> 0.1.2
~> 2.7
~> 0.8
~> 0.25.4
= 3.5.1
~> 3.1
~> 0.9
~> 2.0
 Project Readme

Nexmo OAS Renderer

Build Status MIT licensed

Sinatra application that provides a preview of how the OAS documents will be rendered within Nexmo Developer.

  • Dependencies
  • Installation and Usage
    • Using Docker
    • As a standalone application
    • Mounted into a Rails application
    • Specifying the path to the documents
  • Contributing
  • License

Dependencies

Installation and Usage

Using Docker

You can run using Docker and it will serve the current directory (this will usually be the api-specification repo):

Mac/Linux

docker run --rm -p 4567:4567 -v `pwd`:/definitions -e 'OAS_PATH=/definitions' nexmodev/nexmo-oas-renderer:latest

Alternatively, add the following to your ~/.bashrc file and you'll be able to run nexmo-oas-renderer

function nexmo-oas-renderer() {
  docker run --rm -p 4567:4567 -v `pwd`:/definitions -e 'OAS_PATH=/definitions' nexmodev/nexmo-oas-renderer:latest
}

Windows

docker run --rm -p 4567:4567 -v %CD%:/definitions -e 'OAS_PATH=/definitions' nexmodev/nexmo-oas-renderer:latest

As a standalone application

Install the gem:

$ gem install nexmo-oas-renderer

And simply run the executable with the corresponding env variables set (see Note):

$ nexmo-oas-renderer

Or, if you want to make code changes, just run the following command which will start the web server on http://localhost:9393:

OAS_PATH=... bundle exec shotgun lib/nexmo/oas/renderer/config.ru

Mounted into a Rails Application

Add this to your application's Gemfile:

gem 'nexmo-oas-renderer', require: false

And then run bundle install.

Require the gem in config/environment.rb as follows:

# Load the Rails application.
require_relative 'application'

require 'nexmo/oas/renderer'

# Initialize the Rails application.
Rails.application.initialize!

And finally mount the Sinatra app into your Rails application by adding the following line to config/routes.rb:

mount Nexmo::OAS::Renderer::API, at: '/api'

Specifying the path to the documents

This gem uses dotenv to handle environment variables, so you should copy the .env.example provided by running:

$ cp .env.example .env

and assign values to the corresponding variables.

Note

The env variable OAS_PATH indicates the path to the documents that will be rendered.

Contributing

We ❤️ contributions from everyone! Bug reports, bug fixes and feedback on the library is always appreciated. Look at the Contributor Guidelines for more information and please follow the GitHub Flow.

License

This project is under the MIT LICENSE.