openapi-generator/samples/server/petstore/ruby-sinatra
Akihito Nakano afb238814d [Ruby] Abstract Ruby Codegen (#562)
* Add AbstractRubyCodegen

* Refactor constructor

* Move escapeReservedWord() to AbstractRubyCodegen

* Move getTypeDeclaration() to AbstractRubyCodegen

* Move toDefaultValue() to AbstractRubyCodegen

* Move toVarName() to AbstractRubyCodegen

* Move toParamName() to AbstractRubyCodegen

* Move toOperationId() to AbstractRubyCodegen

* Move escapeQuotationMark() to AbstractRubyCodegen

* Move escapeUnsafeCharacters() to AbstractRubyCodegen

* Use super.escapeReservedWord()

* RubyClientCodegen extends AbstractRubyCodegen

* Add the differences with AbstractRubyCodegen to "reservedWords"

* cliOptions.clear() is not a language specific matter

- Rails, Sinatra requires cliOptions.clear()
- Ruby client doesn't requires that

* Remove duplicated statements with AbstractRubyCodegen

* Remove duplicated methods with AbstractRubyCodegen

* Merge toVarName() into AbstractRubyCodegen

* Merge getTypeDeclaration() into AbstractRubyCodegen

* Merge toDefaultValue() into AbstractRubyCodegen

* Update Ruby related samples

- bin/ruby-client-petstore.sh
- bin/ruby-on-rails-server-petstore.sh
- bin/ruby-sinatra-server-petstore.sh

* Remove unnecessary 'import'

* Avoid unnecessary HTML escaping
2018-07-17 09:08:42 +08:00
..
.openapi-generator [Ruby] Rename files/folders (#534) 2018-07-13 22:28:17 +08:00
api [Ruby] Abstract Ruby Codegen (#562) 2018-07-17 09:08:42 +08:00
lib [Ruby] Rename files/folders (#534) 2018-07-13 22:28:17 +08:00
.openapi-generator-ignore [Ruby] Rename files/folders (#534) 2018-07-13 22:28:17 +08:00
config.ru [Ruby] Rename files/folders (#534) 2018-07-13 22:28:17 +08:00
Gemfile [Ruby] Rename files/folders (#534) 2018-07-13 22:28:17 +08:00
Gemfile.lock [Ruby] Rename files/folders (#534) 2018-07-13 22:28:17 +08:00
my_app.rb [Ruby] Rename files/folders (#534) 2018-07-13 22:28:17 +08:00
openapi.yaml [Ruby] Rename files/folders (#534) 2018-07-13 22:28:17 +08:00
README.md [Ruby] Rename files/folders (#534) 2018-07-13 22:28:17 +08:00
swagger.yaml [Ruby] Rename files/folders (#534) 2018-07-13 22:28:17 +08:00

Swagger for Sinatra

Overview

This is a project to provide Swagger support inside the Sinatra framework. You can find out more about both the spec and the framework at http://swagger.io. For more information about Wordnik's APIs, please visit http://developer.wordnik.com.

Prerequisites

You need to install ruby 1.9.3 and the following gems:

sinatra
sinatra-cross_origin

Getting started

This sample was generated with the OpenAPI Generator project.

rackup -p 4567 config.ru

In your swagger ui, put in the following URL:

http://localhost:4567/resources.json

Voila!