swagger-dsl 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b131abdb9e40b72e5958ab7c2a7e34b42cf21e162ef01726feab2585b1e6e450
4
- data.tar.gz: dec48a00848fc65cf08fa11ebb4369cfa9793491ea10884bc472eb848ddeee06
3
+ metadata.gz: 1ba3213fa4bee6bcf07aab60aea7b6761cf64a3bb15ead9f40fd9d5b35e12842
4
+ data.tar.gz: 02b41c4c0890e96aa2bacfe71dfc96a9bb7cb809d65037f031a0e021b2b826a3
5
5
  SHA512:
6
- metadata.gz: 5ab34c7b9ca4de4d1dd3eb8bcabfdfb06a6090d6c3cace125abe1d67511bc00c876303bce1f2825a70e5573b737477f8c849e8d4539478c3bcfe5187e0f34a10
7
- data.tar.gz: da64cb44e3c4bee8ee6f4249be6393c86b181729fc2cf48e245279f94c883df775a9234f90ede60c35862e3051296b86ffdf8d376084aab398c68a8e85156f23
6
+ metadata.gz: ab9aa6f9a7227be6e379b406fc5ff88c90ebef26856b4f22dd7ee8e902394db97d079491f1a377aadf72081092627d3615c524d4042b214e783f93b5791f78e5
7
+ data.tar.gz: ee5082bbf2f9acac4b3993aeccafbddfbbc3449d7d9977f5a3fce4cc1b7470f333b752a74c28d6b735fd5fb647175c83816576e6b6cbcf1ee0e5e679d0b5fc53
File without changes
data/.gitignore CHANGED
File without changes
File without changes
data/.rspec CHANGED
File without changes
File without changes
File without changes
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
@@ -42,11 +42,10 @@ end
42
42
  class UsersController < ApplicationController
43
43
  swagger :update do
44
44
  params do
45
- path :id, schema: :integer, required: true
45
+ path :id, schema: :integer
46
46
  query do
47
- safe schema: :boolean
47
+ safe schema: :boolean, required: false
48
48
  redirect do
49
- required true
50
49
  schema do
51
50
  string!
52
51
  format! "url"
@@ -83,6 +82,14 @@ Swagger::DSL.current["info"] = {
83
82
  JSON.dump(Swagger::DSL.current)
84
83
  ```
85
84
 
85
+ ### required default
86
+
87
+ Body and response parameters are "required" default in default DSL.
88
+
89
+ So `params` are also default "required".
90
+
91
+ If you do not want it, `Swagger::DSL.current.config.default_required = false`.
92
+
86
93
  ## Development
87
94
 
88
95
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/Rakefile CHANGED
File without changes
File without changes
@@ -3,7 +3,7 @@ require_relative "./parameters"
3
3
  require_relative "../dsl"
4
4
 
5
5
  module Swagger
6
- class DSL
6
+ class DSL < Hash
7
7
  class Components < Hash
8
8
  STRING = "".freeze
9
9
 
@@ -1,5 +1,5 @@
1
1
  module Swagger
2
- class DSL
2
+ class DSL < Hash
3
3
  class Config
4
4
  attr_accessor :inject_key, :default_dsl, :dsl_options, :eager, :default_required
5
5
 
@@ -3,7 +3,7 @@ require_relative "./json_schema/jimmy"
3
3
  require_relative "../dsl"
4
4
 
5
5
  module Swagger
6
- class DSL
6
+ class DSL < Hash
7
7
  class JsonSchema
8
8
  def self.by(dsl_type = nil)
9
9
  dsl_type ||= Swagger::DSL.current.config.default_dsl
@@ -2,7 +2,7 @@ require "jimmy"
2
2
  require_relative "./jimmy_patch"
3
3
 
4
4
  module Swagger
5
- class DSL
5
+ class DSL < Hash
6
6
  class JsonSchema
7
7
  class Jimmy
8
8
  DOMAIN = ::Jimmy::Domain.new("")
@@ -2,7 +2,7 @@ require "json/schema/subset/dsl"
2
2
  require_relative "../../dsl"
3
3
 
4
4
  module Swagger
5
- class DSL
5
+ class DSL < Hash
6
6
  class JsonSchema
7
7
  class SubsetDSL
8
8
  def self.dsl(&block)
@@ -3,7 +3,7 @@ require_relative "./parameters"
3
3
  require_relative "../dsl"
4
4
 
5
5
  module Swagger
6
- class DSL
6
+ class DSL < Hash
7
7
  class Operation < Hash
8
8
  FORMAT_TYPE = {
9
9
  json: "application/json",
@@ -1,7 +1,7 @@
1
1
  require_relative "./json_schema"
2
2
 
3
3
  module Swagger
4
- class DSL
4
+ class DSL < Hash
5
5
  class Parameter < Hash
6
6
  def initialize(options, *args, &block)
7
7
  @default_required = options[:default_required]
@@ -1,7 +1,7 @@
1
1
  require_relative "./parameters_in_type"
2
2
 
3
3
  module Swagger
4
- class DSL
4
+ class DSL < Hash
5
5
  class Parameters < Array
6
6
  def initialize(default_required:, &block)
7
7
  @default_required = default_required
File without changes
@@ -2,7 +2,7 @@ require_relative "../dsl"
2
2
  require_relative "./operation"
3
3
 
4
4
  module Swagger
5
- class DSL
5
+ class DSL < Hash
6
6
  module RailsController
7
7
  class NotMatch < StandardError; end
8
8
  class NotExactMatch < StandardError; end
@@ -3,7 +3,7 @@ require "hana"
3
3
  require "active_support/core_ext/object/deep_dup"
4
4
 
5
5
  module Swagger
6
- class DSL
6
+ class DSL < Hash
7
7
  module ResolveModule
8
8
  def resolved
9
9
  JsonRefs.call(deep_dup)
@@ -2,7 +2,7 @@ require_relative "../dsl"
2
2
  require_relative "./json_schema"
3
3
 
4
4
  module Swagger
5
- class DSL
5
+ class DSL < Hash
6
6
  module Serializer
7
7
  def swagger(dsl: nil, &block)
8
8
  name = self.name.sub(/Serializer$/, "")
@@ -1,5 +1,5 @@
1
1
  module Swagger
2
2
  class DSL < Hash
3
- VERSION = "1.2.0".freeze
3
+ VERSION = "1.2.1".freeze
4
4
  end
5
5
  end
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swagger-dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Narazaka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-01 00:00:00.000000000 Z
11
+ date: 2019-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jimmy
@@ -264,7 +264,7 @@ metadata:
264
264
  homepage_uri: https://github.com/Narazaka/swagger-dsl
265
265
  source_code_uri: https://github.com/Narazaka/swagger-dsl.git
266
266
  changelog_uri: https://github.com/Narazaka/swagger-dsl/blob/master/CHANGELOG.md
267
- documentation_uri: https://www.rubydoc.info/gems/swagger-dsl/1.2.0
267
+ documentation_uri: https://www.rubydoc.info/gems/swagger-dsl/1.2.1
268
268
  post_install_message:
269
269
  rdoc_options: []
270
270
  require_paths:
@@ -280,7 +280,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  - !ruby/object:Gem::Version
281
281
  version: '0'
282
282
  requirements: []
283
- rubygems_version: 3.0.3
283
+ rubyforge_project:
284
+ rubygems_version: 2.7.6
284
285
  signing_key:
285
286
  specification_version: 4
286
287
  summary: Swagger (OpenAPI 3) DSL