oas_core 1.3.0 → 1.4.1

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: 25745b92adac67103b83e87c32b5e4ad79fa05addd4c18c36638a726e5c265d7
4
- data.tar.gz: 584a858c3cba7df7ebf9a9f219f4580db1237dae3a2f07a3ac0d02f90e6f5b8b
3
+ metadata.gz: 2b7fff636be925e25278a987158cc802337d3e90560a958aa18aad4197f97a06
4
+ data.tar.gz: 011c393af762dc61e60fb6a823e625145f2a9bf1addfce5edfb9eb0a901b4b10
5
5
  SHA512:
6
- metadata.gz: 1d62dbfe664d07dea17bd9f47b20cacc743e4e44fd6011c5e9e0b56c9dfd22ab8ac795590345014304e69708e734c9f45f55a8faa62a77a17ed94449fde713f9
7
- data.tar.gz: 4135466e3a1c2a006ddf29d298676557cb65b7f750870e735eaf8af2da0c55bbb44b8f84769a2cf9bc39983f9a530f39c2fe25e5b618a2434bc02dded874da3c
6
+ metadata.gz: d3efcb0f75eb82138df3bb61b9fdccffc721744a490dd63cc18db4897ef24a84eff84169d60df774d3011ca45f5f2ef86635d3019e980d08bea61b9b5505d2c2
7
+ data.tar.gz: b15ff547e983d889c2d651d2367d623bef5ef0697c7288df721922c65553e16576f459739c1de2c951d9fc95db66241a506ecb975377167701fb2bb06c197d3b
@@ -14,6 +14,7 @@ module OasCore
14
14
  @operation.description = oas_route.docstring
15
15
  @operation.tags = extract_tags(oas_route:)
16
16
  @operation.security = extract_security(oas_route:)
17
+ @operation.deprecated = oas_route.tags(:deprecated).any?
17
18
  @operation.parameters = ParametersBuilder.new(@specification).from_oas_route(oas_route).build
18
19
  @operation.request_body = extract_request_body(oas_route)
19
20
  @operation.responses = ResponsesBuilder.new(@specification)
@@ -31,9 +31,13 @@ module OasCore
31
31
  when Array
32
32
  obj.map { |v| hash_representation_recursive(v) }
33
33
  when Hashable
34
- obj.hash_representation
34
+ hash_representation_recursive(obj.hash_representation)
35
35
  else
36
- obj
36
+ # Objects that serialize to a spec (e.g. MediaType) are hashed by
37
+ # their serialized form. Falling through to the default branch would
38
+ # embed their `inspect` output — memory address included — making
39
+ # the digest different on every run.
40
+ obj.respond_to?(:to_spec) ? hash_representation_recursive(obj.to_spec) : obj
37
41
  end
38
42
  end
39
43
  end
@@ -6,7 +6,7 @@ module OasCore
6
6
  include Specable
7
7
 
8
8
  attr_accessor :specification, :tags, :summary, :description, :operation_id, :parameters, :request_body,
9
- :responses, :security
9
+ :responses, :security, :deprecated
10
10
 
11
11
  def initialize(specification)
12
12
  @specification = specification
@@ -18,10 +18,11 @@ module OasCore
18
18
  @request_body = {}
19
19
  @responses = Spec::Responses.new(specification)
20
20
  @security = []
21
+ @deprecated = false
21
22
  end
22
23
 
23
24
  def oas_fields
24
- %i[tags summary description operation_id parameters request_body responses security]
25
+ %i[tags summary description operation_id parameters request_body responses security deprecated]
25
26
  end
26
27
  end
27
28
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OasCore
4
- VERSION = '1.3.0'
4
+ VERSION = '1.4.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oas_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - a-chacon