mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 15:22:56 +00:00
Add install generator and support Rails 3 or 4
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
Rails.application.configure do
|
||||
Dummy::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
# In the development environment your application's code is reloaded on
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Rails.application.configure do
|
||||
Dummy::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
# Code is not reloaded between requests.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Rails.application.configure do
|
||||
Dummy::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
# The test environment is used exclusively to run your application's
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Version of your assets, change this if you want to expire all your assets.
|
||||
Rails.application.config.assets.version = '1.0'
|
||||
|
||||
# Add additional assets to the asset load path
|
||||
# Rails.application.config.assets.paths << Emoji.images_path
|
||||
|
||||
# Precompile additional assets.
|
||||
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
||||
# Rails.application.config.assets.precompile += %w( search.js )
|
||||
@@ -1,3 +0,0 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
Rails.application.config.action_dispatch.cookies_serializer = :json
|
||||
@@ -1,4 +0,0 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Configure sensitive parameters which will be filtered from the log file.
|
||||
Rails.application.config.filter_parameters += [:password]
|
||||
7
spec/dummy/config/initializers/secret_token.rb
Normal file
7
spec/dummy/config/initializers/secret_token.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Your secret key for verifying the integrity of signed cookies.
|
||||
# If you change this key, all old signed cookies will become invalid!
|
||||
# Make sure the secret is at least 30 characters and all random,
|
||||
# no regular words or you'll be exposed to dictionary attacks.
|
||||
Dummy::Application.config.secret_token = '07099944b891552ced4568b48028614b5e481f61503d2794b50121e12c7ef560cda886d188636c504ae24bbb7dcdc01bb3fd9327c2cdae374a3afa42c37b02d9'
|
||||
6
spec/dummy/config/initializers/swagger_rails.rb
Normal file
6
spec/dummy/config/initializers/swagger_rails.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
SwaggerRails.configure do |c|
|
||||
|
||||
# Specify the API version and hence discovery_url (e.g. swagger/v1/swagger.json)
|
||||
# that will be used to power the embedded swagger-ui
|
||||
c.target_api_version = 'v1'
|
||||
end
|
||||
@@ -1,9 +0,0 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# This file contains settings for ActionController::ParamsWrapper which
|
||||
# is enabled by default.
|
||||
|
||||
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
||||
ActiveSupport.on_load(:action_controller) do
|
||||
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
||||
end
|
||||
@@ -2,21 +2,22 @@
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"version": "0.0.0",
|
||||
"title": "Dummy app for testing swagger_rails"
|
||||
"title": "[Enter a description for your API here]",
|
||||
"description": "The docs below are powered by the default swagger.json that was installed with swagger_rails. You can update it to describe your API. See here for the complete swagger spec - https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md"
|
||||
},
|
||||
"paths": {
|
||||
"/events": {
|
||||
"/a/sample/resource": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"events"
|
||||
"a/sample/resource"
|
||||
],
|
||||
"description": "Create a new Event",
|
||||
"description": "Create a new sample resource",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/CreateEventBody"
|
||||
"$ref": "#/definitions/CreateSampleResource"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -29,7 +30,7 @@
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"CreateEventBody": {
|
||||
"CreateSampleResource": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
@@ -37,60 +38,6 @@
|
||||
"date_time": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"repeat": {
|
||||
"$ref": "#/definitions/EventRepeatOptions"
|
||||
},
|
||||
"notification": {
|
||||
"$ref": "#/definitions/EventNotificationOptions"
|
||||
}
|
||||
}
|
||||
},
|
||||
"EventRepeatOptions": {
|
||||
"properties": {
|
||||
"frequency": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"daily"
|
||||
]
|
||||
},
|
||||
"ending_on": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
}
|
||||
},
|
||||
"EventNotificationOptions": {
|
||||
"properties": {
|
||||
"intervals": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
}
|
||||
},
|
||||
"targets": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/NotificationTarget"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"NotificationTarget": {
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"sms",
|
||||
"email"
|
||||
]
|
||||
},
|
||||
"phone": {
|
||||
"type": "string"
|
||||
},
|
||||
"email": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user