oas_rails 0.4.2 → 0.4.4

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: 99f785633c605daf49dae444252b0bf2782a98621be1ead063bdd0d1ffb26014
4
- data.tar.gz: d2b8f108c8fd8ceab1a286247cb5763663ecd1b6d87bb97677bdf09fe25917c8
3
+ metadata.gz: 9133a363344d579b22d73d0fae3bd21758e713f718bfb560d1de96c6e493940f
4
+ data.tar.gz: 2b058a01961a35646aee0cbf76d4719f0b270ee5909592cc3d4f403f9b3d6d70
5
5
  SHA512:
6
- metadata.gz: c30ec251db3f3397e3adc78974f80fd74fa4bfc4ad21385f9b9a120a12d8d8ac8655bd815be60e1b4769898f297cb5816f8851b23fd78eadb5ec0df14c21dd89
7
- data.tar.gz: 2b4e29a8d2e47a4e7e9142b44a80d0a6504d93d3bca72cfe4b3a18fcbe111fdbd743876d678163099e64a04e192ec515197b5a831245c2487611f284e9ec6cec
6
+ metadata.gz: 89e795085c0c4a6138a5a1929ae40bf28cb965e69df2696912226a86a07eb0fbc0337939642a71519736fa5811843f93e5a5066ff9e55dd561077d69e109fce5
7
+ data.tar.gz: 9466e8d29aaadc26276ef494287ac1d7405c1a686b5cfb1d4273f805ef0b4aff0ecd8e2fe50533a85b77416696d9260289caf6da9007c72634235bee39a3ac23
@@ -8,7 +8,9 @@ module OasRails
8
8
 
9
9
  def from_path(path, route_extractor: Extractors::RouteExtractor)
10
10
  route_extractor.host_routes_by_path(path).each do |oas_route|
11
- @path_item.add_operation(oas_route.verb.downcase, OperationBuilder.new(@specification).from_oas_route(oas_route).build)
11
+ oas_route.verb.downcase.split("|").each do |v|
12
+ @path_item.add_operation(v, OperationBuilder.new(@specification).from_oas_route(oas_route).build)
13
+ end
12
14
  end
13
15
 
14
16
  self
@@ -34,7 +34,7 @@ module OasRails
34
34
  status_int = Utils.status_to_integer(status)
35
35
  content = Builders::ContentBuilder.new(specification, :outgoing).with_schema(schema).with_examples(examples).build
36
36
 
37
- Builders::ResponseBuilder.new(specification).with_code(status_int).with_description(Utils.status_code_to_text(status_int)).with_content(content).build
37
+ Builders::ResponseBuilder.new(specification).with_code(status_int).with_description(Utils.get_definition(status_int)).with_content(content).build
38
38
  end
39
39
 
40
40
  # Builds schema and examples based on the content type.
@@ -80,8 +80,7 @@ module OasRails
80
80
  if status.to_s =~ /^\d+$/
81
81
  status.to_i
82
82
  else
83
- # status = "unprocessable_content" if status == "unprocessable_entity"
84
- Rack::Utils::SYMBOL_TO_STATUS_CODE[status.to_sym]
83
+ Rack::Utils.status_code(status.to_sym)
85
84
  end
86
85
  end
87
86
 
@@ -89,10 +88,6 @@ module OasRails
89
88
  #
90
89
  # @param status_code [Integer] The status code.
91
90
  # @return [String] The text description of the status code.
92
- def status_code_to_text(status_code)
93
- Rack::Utils::HTTP_STATUS_CODES[status_code] || "Unknown Status Code"
94
- end
95
-
96
91
  def get_definition(status_code)
97
92
  HTTP_STATUS_DEFINITIONS[status_code] || "Definition not found for status code #{status_code}"
98
93
  end
@@ -1,3 +1,3 @@
1
1
  module OasRails
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oas_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - a-chacon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-15 00:00:00.000000000 Z
11
+ date: 2024-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: method_source
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 7.0.0
47
+ version: '7.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 7.0.0
54
+ version: '7.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: yard
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  requirements: []
153
- rubygems_version: 3.3.3
153
+ rubygems_version: 3.5.11
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: OasRails is a Rails engine for generating automatic interactive documentation