oas_rails 0.8.2 → 0.8.4
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/README.md +2 -0
- data/app/views/oas_rails/oas_rails/index.html.erb +4 -0
- data/lib/oas_rails/configuration.rb +5 -1
- data/lib/oas_rails/spec/components.rb +13 -2
- data/lib/oas_rails/spec/path_item.rb +1 -1
- data/lib/oas_rails/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 332f05d28a00e139df0d677f1fc187def7757e93543f9095d4e834d1cd65cccd
|
4
|
+
data.tar.gz: 41e70d4a52a5d3cf134846a9bcbe9b4c86f4fafb4cfea4e74dacdc8591c818dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94c4b02f0c647c39c96e84e05b90486115afd2f72e11ffafec550b96d1deb4d98ae978063260b8d7f9a76a9d23f64c480bc235b0bcac61bfa7ba84d80f83cdf1
|
7
|
+
data.tar.gz: a61c8a315b1924be46ac68478d795d9c69539a1831364ec05aa82f7200d0f18549ba09e3933338e2d50977cb9230c5f9e49b77dcf2e12d6905f9c4c683647a48
|
data/README.md
CHANGED
@@ -112,6 +112,8 @@ Then fill it with your data. Below are the available configuration options:
|
|
112
112
|
- `config.autodiscover_responses`: Automatically detects responses from controller renders. Default is `true`.
|
113
113
|
- `config.api_path`: Sets the API path if your API is under a different namespace.
|
114
114
|
- `config.ignored_actions`: Sets an array with the controller or controller#action. No necessary to add api_path before.
|
115
|
+
- `config.http_verbs`: Defaults to `[:get, :post, :put, :patch, :delete]`
|
116
|
+
- `config.use_model_names`: Use model names when possible, defaults to `false`
|
115
117
|
|
116
118
|
### Authentication Settings
|
117
119
|
|
@@ -11,7 +11,9 @@ module OasRails
|
|
11
11
|
:authenticate_all_routes_by_default,
|
12
12
|
:set_default_responses,
|
13
13
|
:possible_default_responses,
|
14
|
-
:response_body_of_default
|
14
|
+
:response_body_of_default,
|
15
|
+
:http_verbs,
|
16
|
+
:use_model_names
|
15
17
|
attr_reader :servers, :tags, :security_schema
|
16
18
|
|
17
19
|
def initialize
|
@@ -30,7 +32,9 @@ module OasRails
|
|
30
32
|
@security_schemas = {}
|
31
33
|
@set_default_responses = true
|
32
34
|
@possible_default_responses = [:not_found, :unauthorized, :forbidden]
|
35
|
+
@http_verbs = [:get, :post, :put, :patch, :delete]
|
33
36
|
@response_body_of_default = "Hash{ success: !Boolean, message: String }"
|
37
|
+
@use_model_names = false
|
34
38
|
end
|
35
39
|
|
36
40
|
def security_schema=(value)
|
@@ -44,9 +44,20 @@ module OasRails
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def add_schema(schema)
|
47
|
-
key =
|
48
|
-
|
47
|
+
key = nil
|
48
|
+
if OasRails.config.use_model_names
|
49
|
+
if schema[:type] == 'array'
|
50
|
+
arr_schema = schema[:items]
|
51
|
+
arr_key = arr_schema['title']
|
52
|
+
key = "#{arr_key}List" unless arr_key.nil?
|
53
|
+
else
|
54
|
+
key = schema['title']
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
key = Hashable.generate_hash(schema) if key.nil?
|
49
59
|
|
60
|
+
@schemas[key] = schema if @schemas[key].nil?
|
50
61
|
schema_reference(key)
|
51
62
|
end
|
52
63
|
|
data/lib/oas_rails/version.rb
CHANGED
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.8.
|
4
|
+
version: 0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- a-chacon
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: method_source
|
@@ -128,7 +128,7 @@ licenses:
|
|
128
128
|
- GPL-3.0-only
|
129
129
|
metadata:
|
130
130
|
homepage_uri: https://github.com/a-chacon/oas_rails
|
131
|
-
post_install_message:
|
131
|
+
post_install_message:
|
132
132
|
rdoc_options: []
|
133
133
|
require_paths:
|
134
134
|
- lib
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
144
|
version: '0'
|
145
145
|
requirements: []
|
146
146
|
rubygems_version: 3.5.11
|
147
|
-
signing_key:
|
147
|
+
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: OasRails is a Rails engine for generating automatic interactive documentation
|
150
150
|
for your Rails APIs.
|