mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-24 23:06:41 +00:00
whitespace linting
This commit is contained in:
parent
8b61984fb3
commit
77d00407a4
@ -3,7 +3,7 @@ require 'json-schema'
|
|||||||
module Rswag
|
module Rswag
|
||||||
module Specs
|
module Specs
|
||||||
class ExtendedSchema < JSON::Schema::Draft4
|
class ExtendedSchema < JSON::Schema::Draft4
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
super
|
super
|
||||||
@attributes['type'] = ExtendedTypeAttribute
|
@attributes['type'] = ExtendedTypeAttribute
|
||||||
@ -13,7 +13,7 @@ module Rswag
|
|||||||
end
|
end
|
||||||
|
|
||||||
class ExtendedTypeAttribute < JSON::Schema::TypeV4Attribute
|
class ExtendedTypeAttribute < JSON::Schema::TypeV4Attribute
|
||||||
|
|
||||||
def self.validate(current_schema, data, fragments, processor, validator, options={})
|
def self.validate(current_schema, data, fragments, processor, validator, options={})
|
||||||
return if data.nil? && current_schema.schema['x-nullable'] == true
|
return if data.nil? && current_schema.schema['x-nullable'] == true
|
||||||
super
|
super
|
||||||
|
|||||||
@ -5,7 +5,7 @@ module Rswag
|
|||||||
rake_tasks do
|
rake_tasks do
|
||||||
load File.expand_path('../../../tasks/rswag-specs_tasks.rake', __FILE__)
|
load File.expand_path('../../../tasks/rswag-specs_tasks.rake', __FILE__)
|
||||||
end
|
end
|
||||||
|
|
||||||
generators do
|
generators do
|
||||||
require 'generators/rspec/swagger/swagger_generator.rb'
|
require 'generators/rspec/swagger/swagger_generator.rb'
|
||||||
end
|
end
|
||||||
|
|||||||
@ -54,7 +54,7 @@ module Rswag
|
|||||||
definitions[key]
|
definitions[key]
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_verb(request, metadata)
|
def add_verb(request, metadata)
|
||||||
request[:verb] = metadata[:operation][:verb]
|
request[:verb] = metadata[:operation][:verb]
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ module Rswag
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Content-Type header
|
# Content-Type header
|
||||||
consumes = metadata[:operation][:consumes] || swagger_doc[:consumes]
|
consumes = metadata[:operation][:consumes] || swagger_doc[:consumes]
|
||||||
if consumes
|
if consumes
|
||||||
content_type = example.respond_to?(:'Content-Type') ? example.send(:'Content-Type') : consumes.first
|
content_type = example.respond_to?(:'Content-Type') ? example.send(:'Content-Type') : consumes.first
|
||||||
tuples << [ 'Content-Type', content_type ]
|
tuples << [ 'Content-Type', content_type ]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user