zero-rails_openapi 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/oas_objs/schema_obj.rb +4 -1
- data/lib/open_api.rb +1 -1
- data/lib/open_api/config.rb +2 -0
- data/lib/open_api/dsl/api.rb +1 -1
- data/lib/open_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6afe25b368bda3ef415c01c9fbd8c22c8cb2d544
|
4
|
+
data.tar.gz: 666ae607f905146f90ecc86b399a0af08edbfff4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c87f34bdc7df1ceb1b7c2e81f825151776a45d36a98f9eb410182250adcd4ea1ca72afb1127c5c1f290a98e14730a750733e2c57cbf1ba892ebb1d7969a03097
|
7
|
+
data.tar.gz: fbf997a1b3f2d603405664e86bcbac793ae58b0067504af01af21179b2600b46761917b3932e216bd96ce56631d249aa7b43b599c4585dc55d643d21935906a5
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,16 @@
|
|
2
2
|
|
3
3
|
## [Unreleased]
|
4
4
|
|
5
|
+
## [2.1.3] - 2020/2/8 - [view diff](https://github.com/zhandao/zero-rails_openapi/compare/v2.1.2...v2.1.3)
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
|
9
|
+
1. Fix response HTTP Status Code's type, restrict to String [issued by @am17torres](https://github.com/zhandao/zero-rails_openapi/issues/60)
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
1. Configurable additionalProperties's default value of Object type [issued by @remuspoienar](https://github.com/zhandao/zero-rails_openapi/issues/61)
|
14
|
+
|
5
15
|
## [2.1.1 - 2.1.2] - 2019/2/12 - [view diff](https://github.com/zhandao/zero-rails_openapi/compare/v2.1.0...v2.1.2)
|
6
16
|
|
7
17
|
### Fixed
|
data/lib/oas_objs/schema_obj.rb
CHANGED
@@ -55,7 +55,10 @@ module OpenApi
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def additional_properties
|
58
|
-
return if processed[:type] != 'object'
|
58
|
+
return if processed[:type] != 'object'
|
59
|
+
default = Config.additional_properties_default_value_of_type_object
|
60
|
+
return { additionalProperties: default } if _addProp.nil? && !default.nil?
|
61
|
+
|
59
62
|
value = _addProp.in?([true, false]) ? _addProp : SchemaObj.new(_addProp, { }).process
|
60
63
|
{ additionalProperties: value }
|
61
64
|
end
|
data/lib/open_api.rb
CHANGED
@@ -50,7 +50,7 @@ module OpenApi
|
|
50
50
|
def init_hash(doc_name)
|
51
51
|
settings = Config.docs[doc_name]
|
52
52
|
doc = { openapi: '3.0.0', **settings.slice(:info, :servers) }.merge!(
|
53
|
-
security: settings[:global_security], tags: [ ], paths: { },
|
53
|
+
security: settings[:global_security] || [], tags: [ ], paths: { },
|
54
54
|
components: {
|
55
55
|
securitySchemes: settings[:securitySchemes] || { },
|
56
56
|
schemas: { }, parameters: { }, requestBodies: { }
|
data/lib/open_api/config.rb
CHANGED
data/lib/open_api/dsl/api.rb
CHANGED
@@ -96,7 +96,7 @@ module OpenApi
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def response code, desc, media_type = nil, headers: { }, data: { }, **options
|
99
|
-
(self[:responses][code] ||= ResponseObj.new(desc)).absorb(desc, media_type, headers: headers, data: data, **options)
|
99
|
+
(self[:responses][code.to_s] ||= ResponseObj.new(desc)).absorb(desc, media_type, headers: headers, data: data, **options)
|
100
100
|
end
|
101
101
|
|
102
102
|
alias_method :resp, :response
|
data/lib/open_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zero-rails_openapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zhandao
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|