oas_rails 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -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: e9ec1769321b530eaf7d00f96827ac3062c4b7ba7a63eb88586bddf67d70dc56
|
4
|
+
data.tar.gz: d61cc8aaf523c8d260ffaf1e6d68810e9e68d275874fbbcc30cea8150f5f4b41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61da9b7abe2bdb8012c9a3c338820f208e73e386174c9e6903eaa01fc572adfb5caa825e273364a487dfd3638f8e8f75db710518dc0d4b391fd6f3dad997ec82
|
7
|
+
data.tar.gz: fc78d7790e5d584f12476baab723c97b74d704850f959db09e9e0c516d8b18bb621b7b0dcd0e1af43d919101c933ceccfcbaf8cdf886eff70aea46b1a36964e8
|
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.3
|
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: 2024-
|
11
|
+
date: 2024-12-21 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.
|