diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..276cbf9 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.3.0 diff --git a/rswag-specs/lib/rswag/specs/extended_schema.rb b/rswag-specs/lib/rswag/specs/extended_schema.rb index 379868d..18bd940 100644 --- a/rswag-specs/lib/rswag/specs/extended_schema.rb +++ b/rswag-specs/lib/rswag/specs/extended_schema.rb @@ -2,11 +2,10 @@ require 'json-schema' module Rswag module Specs - class ExtendedSchema < JSON::Schema::Validator + class ExtendedSchema < JSON::Schema::Draft4 def initialize super - extend_schema_definition("http://json-schema.org/draft-04/schema#") @attributes['type'] = ExtendedTypeAttribute @uri = URI.parse('http://tempuri.org/rswag/specs/extended_schema') end diff --git a/test-app/app/models/blog.rb b/test-app/app/models/blog.rb index 51b0795..e913dba 100644 --- a/test-app/app/models/blog.rb +++ b/test-app/app/models/blog.rb @@ -5,7 +5,7 @@ class Blog < ActiveRecord::Base { id: id, title: title, - content: content + content: nil } end end diff --git a/test-app/config/environments/development.rb b/test-app/config/environments/development.rb index 7886e90..9bcfc66 100644 --- a/test-app/config/environments/development.rb +++ b/test-app/config/environments/development.rb @@ -28,4 +28,6 @@ TestApp::Application.configure do # Expands the lines which load the assets config.assets.debug = true + + config.eager_load = false end diff --git a/test-app/config/environments/production.rb b/test-app/config/environments/production.rb deleted file mode 100644 index a9a5401..0000000 --- a/test-app/config/environments/production.rb +++ /dev/null @@ -1,67 +0,0 @@ -TestApp::Application.configure do - # Settings specified here will take precedence over those in config/application.rb - - # Code is not reloaded between requests - config.cache_classes = true - - # Full error reports are disabled and caching is turned on - config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Disable Rails's static asset server (Apache or nginx will already do this) - config.serve_static_assets = true - - # Compress JavaScripts and CSS - config.assets.compress = true - - # Don't fallback to assets pipeline if a precompiled asset is missed - config.assets.compile = false - - # Generate digests for assets URLs - config.assets.digest = true - - # Defaults to nil and saved in location specified by config.assets.prefix - # config.assets.manifest = YOUR_PATH - - # Specifies the header that your server uses for sending files - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true - - # See everything in the log (default is :info) - # config.log_level = :debug - - # Prepend all log lines with the following tags - # config.log_tags = [ :subdomain, :uuid ] - - # Use a different logger for distributed setups - # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) - - # Use a different cache store in production - # config.cache_store = :mem_cache_store - - # Enable serving of images, stylesheets, and JavaScripts from an asset server - # config.action_controller.asset_host = "http://assets.example.com" - - # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) - # config.assets.precompile += %w( search.js ) - - # Disable delivery errors, bad email addresses will be ignored - # config.action_mailer.raise_delivery_errors = false - - # Enable threaded mode - # config.threadsafe! - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation can not be found) - config.i18n.fallbacks = true - - # Send deprecation notices to registered listeners - config.active_support.deprecation = :notify - - # Log the query plan for queries taking more than this (works - # with SQLite, MySQL, and PostgreSQL) - # config.active_record.auto_explain_threshold_in_seconds = 0.5 -end diff --git a/test-app/config/environments/test.rb b/test-app/config/environments/test.rb index 6dd0bf7..3a35ac5 100644 --- a/test-app/config/environments/test.rb +++ b/test-app/config/environments/test.rb @@ -32,4 +32,6 @@ TestApp::Application.configure do # Print deprecation notices to the stderr config.active_support.deprecation = :stderr + + config.eager_load = false end diff --git a/test-app/config/initializers/secret_token.rb b/test-app/config/initializers/secret_token.rb index 706e45d..843ff63 100644 --- a/test-app/config/initializers/secret_token.rb +++ b/test-app/config/initializers/secret_token.rb @@ -5,3 +5,6 @@ # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. TestApp::Application.config.secret_token = '60f36cd33756d73f362053f1d45256ae50d75440b634ae73b070a6e35a2df38692f59e28e5ecbd1f9f2e850255f6d29a468bc59ac4484c2b7f0548ddbfc1b870' + +# See http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#config-secrets-yml +TestApp::Application.config.secret_key_base = 'f6a820cc8aa76094583cd68ef46a735e25e3278648086355f8bd24721f036959c728c06a28dcecfe695f17ae2db44dfa1424f22b81377f2a1496d4e19f6f7faa' diff --git a/test-app/db/schema.rb b/test-app/db/schema.rb index 4e72efd..cea4d93 100644 --- a/test-app/db/schema.rb +++ b/test-app/db/schema.rb @@ -13,10 +13,10 @@ ActiveRecord::Schema.define(version: 20160218212104) do create_table "blogs", force: :cascade do |t| - t.string "title" + t.string "title", limit: 255 t.text "content" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end end diff --git a/test-app/spec/swagger_helper.rb b/test-app/spec/swagger_helper.rb index a3b76b4..f3202ec 100644 --- a/test-app/spec/swagger_helper.rb +++ b/test-app/spec/swagger_helper.rb @@ -39,7 +39,7 @@ RSpec.configure do |config| properties: { id: { type: 'integer' }, title: { type: 'string' }, - content: { type: 'string' } + content: { type: 'string', 'x-nullable': true } }, required: [ 'id', 'title', 'content' ] } diff --git a/test-app/swagger/v1/swagger.json b/test-app/swagger/v1/swagger.json index acbcd1e..7ee0753 100644 --- a/test-app/swagger/v1/swagger.json +++ b/test-app/swagger/v1/swagger.json @@ -146,7 +146,8 @@ "type": "string" }, "content": { - "type": "string" + "type": "string", + "x-nullable": true } }, "required": [