jsapi 0.9.1 → 0.9.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4631e17cbd92a36a62ab6e7aa139b65afa83fccc2c41da34c3f757f2b077340f
4
- data.tar.gz: 4c547aeb52a0fc74c09389f2c97dd0b8c90883fd36c79b9c502689a25379f3f5
3
+ metadata.gz: 59c9ddcd1965cd62ee1b1bbb0e7f066061eaef6a5f8217c69b6d86ee92230b4a
4
+ data.tar.gz: f02a5ff2b0d13ca4c238356b8d11473432ec71b12b40218639335f9f2f45f1da
5
5
  SHA512:
6
- metadata.gz: 1db64f601b34597e5b13ee820482c5a72d2adef153feac7ef3e1141804df36cc8816f665ee18c73e1b30e50a8c13454bed4c7562d447b2fdaf1b3814d863bd09
7
- data.tar.gz: a4bd27f4fcc7c50ee9447e70777ca54de3e81ee6fd7ab3124817baf54511c90d0d95cf461c09c7fdc42a3bf8b57bb62d91954bc96d8a44a77eb15f9d53d2f5be
6
+ metadata.gz: 4f8f331323ab4d88ba89133f37b0eee8fc6bdb1ab5159f3ce5885b7139d4376e74f6df42ed8232c6ea5c4cb7b373d8ea5a8c866c6833d23f5f1412f6a004ea14
7
+ data.tar.gz: f7061a754b6bbde17046b4cc4cb29eca42daede67f3978f474574c9389d555815e5e11f8f2af021f93985458511790699a64d8cd5fc95b03f421792dcd0dd4a5
@@ -218,7 +218,7 @@ module Jsapi
218
218
  ##
219
219
  # :method: security_requirement
220
220
  # :args: **keywords, &block
221
- # Adds a security requirement.
221
+ # Specifies a security requirement.
222
222
  #
223
223
  # security_requirement do
224
224
  # scheme 'basic_auth'
@@ -38,6 +38,15 @@ module Jsapi
38
38
  #
39
39
  # deprecated true
40
40
 
41
+ ##
42
+ # :method: external_docs
43
+ # :args: **keywords, &block
44
+ # Specifies the external documentation.
45
+ #
46
+ # external_docs url: 'https://foo.bar/docs'
47
+ #
48
+ # See Meta::Operation#external_docs for further information.
49
+
41
50
  ##
42
51
  # :method: description
43
52
  # :args: arg
@@ -162,6 +171,17 @@ module Jsapi
162
171
  end
163
172
  end
164
173
 
174
+ ##
175
+ # :method: security_requirement
176
+ # :args: **keywords, &block
177
+ # Specifies a security requirement.
178
+ #
179
+ # security_requirement do
180
+ # scheme 'basic_auth'
181
+ # end
182
+ #
183
+ # See Meta::Operation#security_requirements for further information.
184
+
165
185
  ##
166
186
  # :method: summary
167
187
  # :args: arg
@@ -5,6 +5,15 @@ module Jsapi
5
5
  # Used to define a schema.
6
6
  class Schema < Base
7
7
 
8
+ ##
9
+ # :method: additional_properties
10
+ # :args: **keywords, &block
11
+ # Specifies the schema of properties that are not explicity specified.
12
+ #
13
+ # additional_properties type: 'string'
14
+ #
15
+ # See Meta::Schema::Object#additional_properties for further information.
16
+
8
17
  # Includes all of the properties from +schemas+. Each argument must be the name of
9
18
  # a schema defined by ClassMethods#api_schema or Definitions#schema.
10
19
  def all_of(*schemas)
@@ -47,8 +56,9 @@ module Jsapi
47
56
  #
48
57
  # enum %w[foo bar]
49
58
 
50
- ## :method: external_docs
51
- ## :args: **keywords, &blocks
59
+ ##
60
+ # :method: external_docs
61
+ # :args: **keywords, &block
52
62
  # Specifies the external documentation.
53
63
  #
54
64
  # See Meta::Schema::Base#external_docs for further information.
@@ -3,6 +3,7 @@
3
3
  module Jsapi
4
4
  module Meta
5
5
  module Callback
6
+ # Specifies a callback reference.
6
7
  class Reference < Base::Reference
7
8
  # Returns a hash representing the \OpenAPI reference object.
8
9
  def to_openapi(*)
@@ -382,10 +382,14 @@ module Jsapi
382
382
  @objects ||= ancestors.each_with_object({}) do |ancestor, objects|
383
383
  self.class.attribute_names.each do |key|
384
384
  case value = ancestor.send(key)
385
- when Hash
386
- (objects[key] ||= {}).reverse_merge!(value)
387
385
  when Array
388
386
  (objects[key] ||= []).push(*value)
387
+ when Hash
388
+ if (hash = objects[key])
389
+ value.each { |k, v| hash[k] = v unless hash.key?(k) }
390
+ else
391
+ objects[key] = value.dup
392
+ end
389
393
  else
390
394
  objects[key] ||= value
391
395
  end
@@ -3,6 +3,7 @@
3
3
  module Jsapi
4
4
  module Meta
5
5
  module Example
6
+ # Specifies an example reference.
6
7
  class Reference < Base::Reference
7
8
  # Returns a hash representing the \OpenAPI reference object.
8
9
  def to_openapi(*)
@@ -3,6 +3,7 @@
3
3
  module Jsapi
4
4
  module Meta
5
5
  module Header
6
+ # Specifies a header reference.
6
7
  class Reference < Base::Reference
7
8
  # Returns a hash representing the \OpenAPI reference object.
8
9
  def to_openapi(*)
@@ -3,6 +3,7 @@
3
3
  module Jsapi
4
4
  module Meta
5
5
  module Link
6
+ # Specifies a link reference.
6
7
  class Reference < Base::Reference
7
8
  # Returns a hash representing the \OpenAPI reference object.
8
9
  def to_openapi(*)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Jsapi
4
4
  module Meta
5
- # Defines an API operation.
5
+ # Specifies an API operation.
6
6
  class Operation < Base::Model
7
7
  include OpenAPI::Extensions
8
8
 
@@ -3,10 +3,10 @@
3
3
  module Jsapi
4
4
  module Meta
5
5
  module Parameter
6
- # Defines a parameter.
6
+ # Specifies a parameter.
7
7
  class Model < Base::Model
8
- include ToOpenAPI
9
8
  include OpenAPI::Extensions
9
+ include ToOpenAPI
10
10
 
11
11
  delegate_missing_to :schema
12
12
 
@@ -3,12 +3,14 @@
3
3
  module Jsapi
4
4
  module Meta
5
5
  module Parameter
6
+ # Specifies a parameter reference.
6
7
  class Reference < Base::Reference
7
8
  include ToOpenAPI
8
9
 
9
- # Returns an array of hashes. Each hash represents an \OpenAPI parameter object
10
- # if the type of the referred parameter is <code>"object"</code>. Otherwise the
11
- # array contains a single hash representing the \OpenAPI reference object.
10
+ # Returns an array of hashes. If the type of the referred parameter is
11
+ # <code>"object"</code>, each hash represents an \OpenAPI parameter object.
12
+ # Otherwise the array contains a single hash representing the \OpenAPI
13
+ # reference object.
12
14
  #
13
15
  # Raises a ReferenceError when the reference could not be resolved.
14
16
  def to_openapi_parameters(version, definitions)
@@ -4,6 +4,7 @@ module Jsapi
4
4
  module Meta
5
5
  module Parameter
6
6
  module ToOpenAPI
7
+ # Returns a hash representing the \OpenAPI parameter or reference object.
7
8
  def to_openapi(version, definitions)
8
9
  to_openapi_parameters(version, definitions).first
9
10
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Jsapi
4
4
  module Meta
5
+ # Specifies a property
5
6
  class Property < Base::Model
6
7
  delegate_missing_to :schema
7
8
 
@@ -3,7 +3,7 @@
3
3
  module Jsapi
4
4
  module Meta
5
5
  module RequestBody
6
- # Defines a request body.
6
+ # Specifies a request body.
7
7
  class Model < Base::Model
8
8
  include OpenAPI::Extensions
9
9
 
@@ -3,6 +3,7 @@
3
3
  module Jsapi
4
4
  module Meta
5
5
  module RequestBody
6
+ # Specifies a request body reference.
6
7
  class Reference < Base::Reference
7
8
  # Returns a hash representing the \OpenAPI reference object.
8
9
  def to_openapi(*)
@@ -3,7 +3,7 @@
3
3
  module Jsapi
4
4
  module Meta
5
5
  module Response
6
- # Defines a response.
6
+ # Specifies a response.
7
7
  class Model < Base::Model
8
8
  include OpenAPI::Extensions
9
9
 
@@ -3,6 +3,7 @@
3
3
  module Jsapi
4
4
  module Meta
5
5
  module Response
6
+ # Specifies a response reference.
6
7
  class Reference < Base::Reference
7
8
  # Returns a hash representing the \OpenAPI reference object.
8
9
  def to_openapi(version, *)
data/lib/jsapi/version.rb CHANGED
@@ -5,6 +5,6 @@ module Jsapi
5
5
  # NOTE: See https://bundler.io/guides/creating_gem.html
6
6
 
7
7
  # The current GEM version.
8
- VERSION = '0.9.1'
8
+ VERSION = '0.9.2'
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Göller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-18 00:00:00.000000000 Z
11
+ date: 2024-10-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: denis@dmgoeller.de