r2-oas 0.3.1 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +50 -0
- data/GEMSPEC.md +2 -2
- data/README.ja.md +54 -37
- data/README.md +55 -32
- data/lib/r2-oas.rb +4 -5
- data/lib/r2-oas/app_configuration.rb +17 -5
- data/lib/r2-oas/app_configuration/deprecation.rb +28 -0
- data/lib/r2-oas/configuration.rb +56 -0
- data/lib/r2-oas/deploy/client.rb +21 -6
- data/lib/r2-oas/{plugins/schema/v3/object → dynamic/schema/v3/object/from_routes}/hookable_base_object.rb +7 -7
- data/lib/r2-oas/errors.rb +5 -0
- data/lib/r2-oas/hooks/hook.rb +7 -5
- data/lib/r2-oas/lib/core_ext/all.rb +5 -0
- data/lib/r2-oas/lib/core_ext/string/filters.rb +29 -0
- data/lib/r2-oas/pluggable_configuration.rb +8 -5
- data/lib/r2-oas/plugin/base.rb +44 -0
- data/lib/r2-oas/plugin/executor.rb +148 -0
- data/lib/r2-oas/plugin/hookable.rb +42 -0
- data/lib/r2-oas/plugin/public.rb +3 -0
- data/lib/r2-oas/plugin/transform/transform.rb +10 -0
- data/lib/r2-oas/plugin/transform/v3/transform.rb +20 -0
- data/lib/r2-oas/plugin/transform/v3/visitable.rb +37 -0
- data/lib/r2-oas/public.rb +5 -0
- data/lib/r2-oas/schema/base.rb +1 -1
- data/lib/r2-oas/schema/builder.rb +1 -1
- data/lib/r2-oas/schema/editor.rb +8 -1
- data/lib/r2-oas/schema/v3/analyzer/path_analyzer.rb +1 -1
- data/lib/r2-oas/schema/v3/builder.rb +1 -1
- data/lib/r2-oas/schema/v3/builder/base_builder.rb +14 -2
- data/lib/r2-oas/schema/v3/builder/doc_builder.rb +10 -2
- data/lib/r2-oas/schema/v3/generator/base_generator.rb +7 -2
- data/lib/r2-oas/schema/v3/generator/doc_generator.rb +1 -1
- data/lib/r2-oas/schema/v3/manager/file/include_ref_base_file_manager.rb +3 -2
- data/lib/r2-oas/schema/v3/object/from_files/base_object.rb +62 -0
- data/lib/r2-oas/schema/v3/object/from_files/components/request_body_object.rb +103 -0
- data/lib/r2-oas/schema/v3/object/from_files/components/schema_object.rb +102 -0
- data/lib/r2-oas/schema/v3/object/from_files/components_object.rb +46 -0
- data/lib/r2-oas/schema/v3/object/from_files/external_document_object.rb +23 -0
- data/lib/r2-oas/schema/v3/object/from_files/info_object.rb +23 -0
- data/lib/r2-oas/schema/v3/object/from_files/openapi_object.rb +61 -0
- data/lib/r2-oas/schema/v3/object/from_files/path_item_object.rb +110 -0
- data/lib/r2-oas/schema/v3/object/from_files/paths_object.rb +33 -0
- data/lib/r2-oas/schema/v3/object/from_files/utils/all.rb +4 -0
- data/lib/r2-oas/schema/v3/object/from_files/utils/deep_methods.rb +27 -0
- data/lib/r2-oas/schema/v3/object/from_files/utils/refs.rb +151 -0
- data/lib/r2-oas/schema/v3/object/{base_object.rb → from_routes/base_object.rb} +11 -1
- data/lib/r2-oas/schema/v3/object/{components → from_routes/components}/request_body_object.rb +23 -19
- data/lib/r2-oas/schema/v3/object/{components → from_routes/components}/schema_object.rb +16 -12
- data/lib/r2-oas/schema/v3/object/{components_object.rb → from_routes/components_object.rb} +11 -11
- data/lib/r2-oas/schema/v3/object/from_routes/external_document_object.rb +28 -0
- data/lib/r2-oas/schema/v3/object/{info_object.rb → from_routes/info_object.rb} +11 -2
- data/lib/r2-oas/schema/v3/object/{openapi_object.rb → from_routes/openapi_object.rb} +12 -11
- data/lib/r2-oas/schema/v3/object/{path_item_object.rb → from_routes/path_item_object.rb} +6 -6
- data/lib/r2-oas/schema/v3/object/{paths_object.rb → from_routes/paths_object.rb} +11 -8
- data/lib/r2-oas/schema/v3/object/{public.rb → from_routes/public.rb} +0 -0
- data/lib/r2-oas/schema/v3/object/{server_object.rb → from_routes/server_object.rb} +0 -0
- data/lib/r2-oas/schema/v3/object/{tag_object.rb → from_routes/tag_object.rb} +2 -1
- data/lib/r2-oas/schema/v3/object/store.rb +54 -0
- data/lib/r2-oas/shared/all.rb +1 -0
- data/lib/r2-oas/shared/callable.rb +17 -0
- data/lib/r2-oas/store.rb +20 -16
- data/lib/r2-oas/support/deprecation.rb +26 -0
- data/lib/r2-oas/support/deprecation/behavior.rb +21 -0
- data/lib/r2-oas/support/deprecation/instance_delegator.rb +42 -0
- data/lib/r2-oas/support/deprecation/reporting.rb +91 -0
- data/lib/r2-oas/task.rb +1 -2
- data/lib/r2-oas/task_logging.rb +3 -7
- data/lib/r2-oas/tasks/common.rake +1 -2
- data/lib/r2-oas/tasks/main.rake +60 -9
- data/lib/r2-oas/version.rb +1 -1
- data/r2-oas.gemspec +1 -6
- metadata +51 -110
- data/.github/ISSUE_TEMPLATE.md +0 -12
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -12
- data/.gitignore +0 -16
- data/.rspec +0 -3
- data/.rubocop.yml +0 -10
- data/.rubocop_todo.yml +0 -291
- data/.travis.yml +0 -26
- data/Appraisals +0 -13
- data/CODE_OF_CONDUCT.md +0 -74
- data/Gemfile +0 -12
- data/Rakefile +0 -8
- data/bin/console +0 -12
- data/bin/setup +0 -8
- data/devscript/all_support_ruby.sh +0 -43
- data/devscript/bundle_for_all_support_ruby.sh +0 -31
- data/devscript/rspec_for_all_support_ruby.sh +0 -27
- data/docs/.nojekyll +0 -0
- data/docs/README.md +0 -173
- data/docs/_sidebar.md +0 -25
- data/docs/attention/if_clash.md +0 -17
- data/docs/index.html +0 -29
- data/docs/schema/3.0.0.md +0 -155
- data/docs/setting/COC.md +0 -14
- data/docs/setting/CORS.md +0 -22
- data/docs/setting/configure.md +0 -176
- data/docs/trableshouting/runtime_error.md +0 -44
- data/docs/usage/analyze_docs.md +0 -875
- data/docs/usage/clean_docs.md +0 -19
- data/docs/usage/deploy_docs.md +0 -839
- data/docs/usage/display_paths_list.md +0 -35
- data/docs/usage/display_paths_stats.md +0 -54
- data/docs/usage/edit_docs.md +0 -218
- data/docs/usage/generate_docs.md +0 -412
- data/docs/usage/monitor_docs.md +0 -219
- data/docs/usage/use_hook_methods.md +0 -236
- data/docs/usage/use_hook_to_generate_docs.md +0 -235
- data/docs/usage/use_schema_namespace.md +0 -181
- data/docs/usage/use_tag_namespace.md +0 -180
- data/docs/usage/view_docs.md +0 -262
- data/gemfiles/ruby_2.3.3.gemfile +0 -11
- data/gemfiles/ruby_2.4.2.gemfile +0 -11
- data/gemfiles/ruby_2.5.8.gemfile +0 -11
- data/gemfiles/ruby_2.6.6.gemfile +0 -11
- data/gemfiles/ruby_2.7.1.gemfile +0 -11
- data/lib/r2-oas/app_configuration/tool.rb +0 -31
- data/lib/r2-oas/app_configuration/tool/paths/stats.rb +0 -43
- data/lib/r2-oas/deploy/swagger-ui/dist/favicon-16x16.png +0 -0
- data/lib/r2-oas/deploy/swagger-ui/dist/favicon-32x32.png +0 -0
- data/lib/r2-oas/deploy/swagger-ui/dist/oauth2-redirect.html +0 -68
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-bundle.js +0 -134
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-bundle.js.map +0 -1
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-standalone-preset.js +0 -22
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-standalone-preset.js.map +0 -1
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.css +0 -4
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.css.map +0 -1
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.js +0 -9
- data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.js.map +0 -1
- data/lib/r2-oas/schema/v3/object/external_document_object.rb +0 -19
- data/lib/r2-oas/tasks/tool.rake +0 -76
- data/lib/r2-oas/tool/paths/ls.rb +0 -15
- data/lib/r2-oas/tool/paths/stats.rb +0 -84
data/docs/attention/if_clash.md
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# If clash
|
2
|
-
|
3
|
-
If you crash while Swagger Editor is running, you can execute the following command to reflect the editing status up to a few seconds before in the local file.
|
4
|
-
|
5
|
-
```bash
|
6
|
-
bundle exec rake routes:oas:analyze
|
7
|
-
```
|
8
|
-
|
9
|
-
It is a file generated by parsing the generated file oas_doc.yml and dividing it into each file.
|
10
|
-
|
11
|
-
## Attention
|
12
|
-
|
13
|
-
Please be aware that if you execute the following command immediately after the crash, the change history will be `lost`.
|
14
|
-
|
15
|
-
```bash
|
16
|
-
bundle exec rake routes:oas:editor
|
17
|
-
```
|
data/docs/index.html
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="en">
|
3
|
-
<head>
|
4
|
-
<meta charset="UTF-8">
|
5
|
-
<title>Document</title>
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
7
|
-
<meta name="description" content="Description">
|
8
|
-
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
9
|
-
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
|
10
|
-
</head>
|
11
|
-
<body>
|
12
|
-
<div id="app"></div>
|
13
|
-
<script>
|
14
|
-
window.$docsify = {
|
15
|
-
auto2top: true,
|
16
|
-
name: '<span>r2-oas</span>',
|
17
|
-
repo: 'https://github.com/yukihirop/r2-oas',
|
18
|
-
loadSidebar: true,
|
19
|
-
subMaxLevel: 2
|
20
|
-
}
|
21
|
-
</script>
|
22
|
-
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
23
|
-
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
|
24
|
-
<script src="//unpkg.com/docsify/lib/plugins/emoji.min.js"></script>
|
25
|
-
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-ruby.min.js"></script>
|
26
|
-
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-bash.min.js"></script>
|
27
|
-
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-diff.min.js"></script>
|
28
|
-
</body>
|
29
|
-
</html>
|
data/docs/schema/3.0.0.md
DELETED
@@ -1,155 +0,0 @@
|
|
1
|
-
# 3.0.0
|
2
|
-
|
3
|
-
## Support Schema
|
4
|
-
|
5
|
-
Generate schema yaml like this:
|
6
|
-
|
7
|
-
- Schema
|
8
|
-
- openapi
|
9
|
-
- info
|
10
|
-
- tags
|
11
|
-
- paths
|
12
|
-
- externalDocs
|
13
|
-
- servers
|
14
|
-
- security
|
15
|
-
- components
|
16
|
-
- schemas
|
17
|
-
- requestBodies
|
18
|
-
- securitySchemes
|
19
|
-
- parameters
|
20
|
-
- responses (experimental)
|
21
|
-
- examples (experimental)
|
22
|
-
- headers (experimental)
|
23
|
-
- links (experimental)
|
24
|
-
- callbacks (experimental)
|
25
|
-
|
26
|
-
## openapi
|
27
|
-
|
28
|
-
Support field like this:
|
29
|
-
|
30
|
-
|field name|field type|
|
31
|
-
|----------|----------|
|
32
|
-
|`openapi`|`string`|
|
33
|
-
|
34
|
-
[show more...](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#openapi-object)
|
35
|
-
|
36
|
-
## info
|
37
|
-
|
38
|
-
Support field like this:
|
39
|
-
|
40
|
-
|field name|field type|
|
41
|
-
|----------|----------|
|
42
|
-
|`title`|`string`|
|
43
|
-
|`description`|`string`|
|
44
|
-
|`termsOfService`|`string`|
|
45
|
-
|`contact`|`Contact Object`|
|
46
|
-
|`license`|`License Object`|
|
47
|
-
|`version`|`string`|
|
48
|
-
|
49
|
-
[show more...](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#info-object)
|
50
|
-
|
51
|
-
## tags
|
52
|
-
|
53
|
-
Support field like this:
|
54
|
-
|
55
|
-
|field name|field type|
|
56
|
-
|----------|----------|
|
57
|
-
|`name`|`string`|
|
58
|
-
|`description`|`string`|
|
59
|
-
|`externalDocs`|`External Document Object`|
|
60
|
-
|
61
|
-
[show more...](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#tagObject)
|
62
|
-
|
63
|
-
## paths
|
64
|
-
|
65
|
-
Support field like this:
|
66
|
-
|
67
|
-
|field name|field type|
|
68
|
-
|----------|----------|
|
69
|
-
|`/{path}`|`Path Item Object`|
|
70
|
-
|
71
|
-
[show more...](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#paths-object)
|
72
|
-
|
73
|
-
for example:
|
74
|
-
```
|
75
|
-
paths:
|
76
|
-
"/users":
|
77
|
-
post:
|
78
|
-
tags:
|
79
|
-
- user
|
80
|
-
summary: post summary
|
81
|
-
description: post description
|
82
|
-
responses:
|
83
|
-
default:
|
84
|
-
description: ''
|
85
|
-
deprecated: false
|
86
|
-
"/{model_name}/{id}":
|
87
|
-
get:
|
88
|
-
tags:
|
89
|
-
- rails_admin/main
|
90
|
-
summary: get summary
|
91
|
-
description: get description
|
92
|
-
responses:
|
93
|
-
default:
|
94
|
-
description: ''
|
95
|
-
'200':
|
96
|
-
description: rails_admin/main description
|
97
|
-
content:
|
98
|
-
application/json:
|
99
|
-
schema:
|
100
|
-
"$ref": "#/components/schemas/Main"
|
101
|
-
deprecated: false
|
102
|
-
parameters:
|
103
|
-
- name: model_name
|
104
|
-
in: path
|
105
|
-
description: model_name
|
106
|
-
required: true
|
107
|
-
schema:
|
108
|
-
type: string
|
109
|
-
- name: id
|
110
|
-
in: path
|
111
|
-
description: id
|
112
|
-
required: true
|
113
|
-
schema:
|
114
|
-
type: integer
|
115
|
-
```
|
116
|
-
|
117
|
-
## externalDocs
|
118
|
-
|
119
|
-
Support field like this:
|
120
|
-
|
121
|
-
|field name|field type|
|
122
|
-
|----------|----------|
|
123
|
-
|`description`|`string`|
|
124
|
-
|`url`|`string`|
|
125
|
-
|
126
|
-
[show more...](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#external-documentation-object)
|
127
|
-
|
128
|
-
## servers
|
129
|
-
|
130
|
-
Support field like this:
|
131
|
-
|
132
|
-
|field name|field type|
|
133
|
-
|----------|----------|
|
134
|
-
|`url`|`string`|
|
135
|
-
|`description`|`string`|
|
136
|
-
|
137
|
-
[show more...](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#server-object)
|
138
|
-
|
139
|
-
## components
|
140
|
-
|
141
|
-
Support field like this:
|
142
|
-
|
143
|
-
|field name|field type|
|
144
|
-
|----------|----------|
|
145
|
-
|`schemas`| `Schema Object` |
|
146
|
-
|`requestBodies`| `Request Body Object`|
|
147
|
-
|`securitySchemes`| `Security Schemes Object` |
|
148
|
-
|`parameters`| `Parameter Object` |
|
149
|
-
|`responses`| `Response Object` |
|
150
|
-
|`examples`| `Example Object` |
|
151
|
-
|`headers`| `Header Object` |
|
152
|
-
|`links`|`Link Object` |
|
153
|
-
|`callbacks`| `Callback Object`|
|
154
|
-
|
155
|
-
[show more...](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#components-object)
|
data/docs/setting/COC.md
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# ❗️Convention over Configuration (CoC)
|
2
|
-
|
3
|
-
- `tag name` represents `controller name` and determine `paths file name`.
|
4
|
-
- For example, If `controller name` is `Api::V1::UsersController`, `tag_name` is `api/v1/user`. and `paths file name` is `api/v1/user.yml`
|
5
|
-
|
6
|
-
- `_` of `components/{schemas,requestBodies, ...} name` convert `/` when save file.
|
7
|
-
- For example, If `components/schemas name` is `Api_V1_User`, `components/schemas file name` is `api/v1/user.yml`.
|
8
|
-
- `_` is supposed to be used to express `namespace`.
|
9
|
-
- format is `Namespace1_Namespace2_Model`.
|
10
|
-
|
11
|
-
- `.` of `components/{schemas,requestBodies, ...} name` convert `/` when save file.
|
12
|
-
- For example, If `components/schemas name` is `api.v1.User`, `components/schemas file name` is `api/v1/user.yml`.
|
13
|
-
- `.` is supposed to be used to express `namespace`.
|
14
|
-
- format is `namespace1.namespace2.Model`.
|
data/docs/setting/CORS.md
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# CORS
|
2
|
-
|
3
|
-
Use [rack-cors](https://github.com/cyu/rack-cors) to enable CORS.
|
4
|
-
|
5
|
-
```ruby
|
6
|
-
require 'rack/cors'
|
7
|
-
use Rack::Cors do
|
8
|
-
allow do
|
9
|
-
origins '*'
|
10
|
-
resource '*', headers: :any, methods: [ :get, :post, :put, :delete, :options ]
|
11
|
-
end
|
12
|
-
end
|
13
|
-
```
|
14
|
-
|
15
|
-
Alternatively you can set CORS headers in a `before` block.
|
16
|
-
|
17
|
-
```ruby
|
18
|
-
before do
|
19
|
-
header['Access-Control-Allow-Origin'] = '*'
|
20
|
-
header['Access-Control-Request-Method'] = '*'
|
21
|
-
end
|
22
|
-
```
|
data/docs/setting/configure.md
DELETED
@@ -1,176 +0,0 @@
|
|
1
|
-
## Configure
|
2
|
-
|
3
|
-
All settings are `optional`. The initial value is as follows.
|
4
|
-
|
5
|
-
In your rails project, Write `config/environments/development.rb` like that:
|
6
|
-
|
7
|
-
```ruby
|
8
|
-
# default setting
|
9
|
-
R2OAS.configure do |config|
|
10
|
-
config.version = :v3
|
11
|
-
config.root_dir_path = "./oas_docs"
|
12
|
-
config.schema_save_dir_name = "src"
|
13
|
-
config.doc_save_file_name = "oas_doc.yml"
|
14
|
-
config.force_update_schema = false
|
15
|
-
config.use_tag_namespace = true
|
16
|
-
config.use_schema_namespace = false
|
17
|
-
config.interval_to_save_edited_tmp_schema = 15
|
18
|
-
# :dot or :underbar
|
19
|
-
config.namespace_type = :underbar
|
20
|
-
config.deploy_dir_path = "./deploy_docs"
|
21
|
-
|
22
|
-
config.server.data = [
|
23
|
-
{
|
24
|
-
url: "http://localhost:3000",
|
25
|
-
description: "localhost"
|
26
|
-
}
|
27
|
-
]
|
28
|
-
|
29
|
-
config.swagger.configure do |swagger|
|
30
|
-
swagger.ui.image = "swaggerapi/swagger-ui"
|
31
|
-
swagger.ui.port = "8080"
|
32
|
-
swagger.ui.exposed_port = "8080/tcp"
|
33
|
-
swagger.ui.volume = "/app/swagger.json"
|
34
|
-
swagger.editor.image = "swaggerapi/swagger-editor"
|
35
|
-
swagger.editor.port = "81"
|
36
|
-
swagger.editor.exposed_port = "8080/tcp"
|
37
|
-
end
|
38
|
-
|
39
|
-
config.use_object_classes = {
|
40
|
-
info_object: R2OAS::Schema::V3::InfoObject,
|
41
|
-
paths_object: R2OAS::Schema::V3::PathsObject,
|
42
|
-
path_item_object: R2OAS::Schema::V3::PathItemObject,
|
43
|
-
external_document_object: R2OAS::Schema::V3::ExternalDocumentObject,
|
44
|
-
components_object: R2OAS::Schema::V3::ComponentsObject,
|
45
|
-
components_schema_object: R2OAS::Schema::V3::Components::SchemaObject,
|
46
|
-
components_request_body_object: R2OAS::Schema::V3::Components::RequestBodyObject
|
47
|
-
}
|
48
|
-
|
49
|
-
config.http_statuses_when_http_method = {
|
50
|
-
get: {
|
51
|
-
default: %w(200 422),
|
52
|
-
path_parameter: %w(200 404 422)
|
53
|
-
},
|
54
|
-
post: {
|
55
|
-
default: %w(201 422),
|
56
|
-
path_parameter: %w(201 404 422)
|
57
|
-
},
|
58
|
-
patch: {
|
59
|
-
default: %w(204 422),
|
60
|
-
path_parameter: %w(204 404 422)
|
61
|
-
},
|
62
|
-
put: {
|
63
|
-
default: %w(204 422),
|
64
|
-
path_parameter: %w(204 404 422)
|
65
|
-
},
|
66
|
-
delete: {
|
67
|
-
default: %w(200 422),
|
68
|
-
path_parameter: %w(200 404 422)
|
69
|
-
}
|
70
|
-
}
|
71
|
-
|
72
|
-
config.http_methods_when_generate_request_body = %w[post patch put]
|
73
|
-
config.ignored_http_statuses_when_generate_component_schema = %w[204 404]
|
74
|
-
|
75
|
-
config.tool.paths_stats.configure do |paths_stats|
|
76
|
-
paths_stats.month_to_turn_to_warning_color = 3
|
77
|
-
paths_stats.warning_color = :red
|
78
|
-
paths_stats.table_title_color = :yellow
|
79
|
-
paths_stats.heading_color = :yellow
|
80
|
-
paths_stats.highlight_color = :magenta
|
81
|
-
end
|
82
|
-
end
|
83
|
-
```
|
84
|
-
|
85
|
-
we explain the options that can be set.
|
86
|
-
|
87
|
-
#### basic
|
88
|
-
|
89
|
-
|option|description|default|
|
90
|
-
|------|-----------|---|
|
91
|
-
|version|OpenAPI schema version| `:v3` |
|
92
|
-
|root_dir_path|Root directory for storing products.| `"./oas_docs"` |
|
93
|
-
|schema_save_dir_name|Directory name for storing swagger schemas|`"src"`|
|
94
|
-
|doc_save_file_name|File name for storing swagger doc|`"oas_doc.yml"`|
|
95
|
-
|force_update_schema|Force update schema from routes data|`false`|
|
96
|
-
|use_tag_namespace|Use namespace for tag name|`true`|
|
97
|
-
|use_schema_namespace|Use namespace for schema name|`true`|
|
98
|
-
|interval_to_save_edited_tmp_schema|Interval(sec) to save edited tmp schema|`15`|
|
99
|
-
|http_statuses_when_http_method|Determine the response to support for each HTTP method|omission...|
|
100
|
-
|http_methods_when_generate_request_body|HTTP methods when generate requestBody|`[post put patch]`|
|
101
|
-
|ignored_http_statuses_when_generate_component_schema|Ignore HTTP statuses when generate component schema|`[204 404]`|
|
102
|
-
|namespace_type|namespace for components(schemas/requestBodies) name| `underbar` |
|
103
|
-
|deploy_dir_path|deploy directory.|`"./deploy_docs"`|
|
104
|
-
|
105
|
-
#### server
|
106
|
-
|
107
|
-
|option|children option|description|default|
|
108
|
-
|------|---------------|-----------|-------|
|
109
|
-
|server|data|Server data (url, description) |[{ url: `http://localhost:3000`, description: `localhost` }] |
|
110
|
-
|
111
|
-
#### swagger
|
112
|
-
|
113
|
-
|option|children option|grandchild option|description|default|
|
114
|
-
|------|---------------|-----------------|-----------|-------|
|
115
|
-
|swagger|ui|image|Swagger UI Docker Image|`"swaggerapi/swagger-ui"`|
|
116
|
-
|swagger|ui|port|Swagger UI Port|`"8080"`|
|
117
|
-
|swagger|ui|exposed_port|Swagger UI Exposed Port|`"8080/tcp"`|
|
118
|
-
|swagger|ui|volume|Swagger UI Volume|`"/app/swagger.json"`|
|
119
|
-
|swagger|editor|image|Swagger Editor Docker Image|`"swaggerapi/swagger-editor"`|
|
120
|
-
|swagger|editor|port|Swagger Editor Port|`"8080"`|
|
121
|
-
|swagger|editor|exposed_port|Swagger Editor Exposed Port|`"8080/tcp"`|
|
122
|
-
|
123
|
-
#### hook
|
124
|
-
|
125
|
-
|option|description|default|
|
126
|
-
|------|-----------|-------|
|
127
|
-
|use_object_classes|Object class(hook class) to generate Openapi document|{ info_object: `R2OAS::Schema::V3::InfoObject`,<br>paths_object: `R2OAS::Schema::V3::PathsObject`,<br>path_item_object: `R2OAS::Schema::V3::PathItemObject`, external_document_object: `R2OAS::Schema::V3::ExternalDocumentObject`,<br> components_object: `R2OAS::Schema::V3::ComponentsObject`,<br> components_schema_object: `R2OAS::Schema::V3::Components::SchemaObject`, <br> components_request_body_object:`R2OAS::Schema::V3::Components::RequestBodyObject` }|
|
128
|
-
|
129
|
-
#### tool
|
130
|
-
|
131
|
-
|option|children option|grandchild option|description|default|
|
132
|
-
|------|---------------|-----------------|-----------|-------|
|
133
|
-
|tool|paths_stats|month_to_turn_to_warning_color|Elapsed month to issue a warning|`3`|
|
134
|
-
|tool|paths_stats|warning_color|Warning Color|`:red`|
|
135
|
-
|tool|paths_stats|table_title_color|Table Title Color|`:yellow`|
|
136
|
-
|tool|paths_stats|heading_color|Heading Color|`:yellow`|
|
137
|
-
|tool|paths_stats|highlight_color|Highlight Color|`:magenta`|
|
138
|
-
|
139
|
-
Please refer to [here](https://github.com/janlelis/paint) for the color.
|
140
|
-
|
141
|
-
## Environment variables
|
142
|
-
|
143
|
-
We explain the environment variables that can be set.
|
144
|
-
|
145
|
-
|variable|description|default|
|
146
|
-
|--------|-----------|-------|
|
147
|
-
|PATHS_FILE|Specify one paths file path|`""`|
|
148
|
-
|OAS_FILE|Specify swagger file path to analyze|`""`|
|
149
|
-
|CACHE_DOCS|Effective only when there is no `.docs` file. Specifying `true` will generate a` .docs` file when the `routes:oas:docs` command is executed.|`false`|
|
150
|
-
|
151
|
-
|
152
|
-
## .paths
|
153
|
-
|
154
|
-
Writing file paths in .paths will only read them.
|
155
|
-
You can comment out with `#`
|
156
|
-
|
157
|
-
`oas_docs/.paths`
|
158
|
-
|
159
|
-
```
|
160
|
-
#account_user_role.yml # ignore
|
161
|
-
account.yml
|
162
|
-
account.yml # ignore
|
163
|
-
account.yml # ignore
|
164
|
-
```
|
165
|
-
|
166
|
-
## .docs
|
167
|
-
|
168
|
-
It holds the information in the current routing as a cache. Thanks to this, when the `routes:oas:docs` command is executed, changes in routing can be detected and appropriate processing can be performed.
|
169
|
-
|
170
|
-
If you want to inspect `.docs`. You can check it by entering the following code with `pry` or something.
|
171
|
-
|
172
|
-
```ruby
|
173
|
-
result = IO.binread("oas_docs/.docs")
|
174
|
-
inflate = Zlib::Inflate.inflate(result)
|
175
|
-
puts Marshal.load(inflate)
|
176
|
-
```
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# Selenium::WebDriver::Error::SessionNotCreatedError
|
2
|
-
|
3
|
-
If you get the following error when running `oas:docs:editor`, the chromedriver may be old
|
4
|
-
|
5
|
-
```bash
|
6
|
-
rake aborted!
|
7
|
-
Selenium::WebDriver::Error::SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 81
|
8
|
-
(Driver info: chromedriver=81.0.4044.69 (6813546031a4bc83f717a2ef7cd4ac6ec1199132-refs/branch-heads/4044@{#776}),platform=Mac OS X 10.14.3 x86_64)
|
9
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/selenium-webdriver-3.142.4/lib/selenium/webdriver/remote/response.rb:72:in `assert_ok'
|
10
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/selenium-webdriver-3.142.4/lib/selenium/webdriver/remote/response.rb:34:in `initialize'
|
11
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/selenium-webdriver-3.142.4/lib/selenium/webdriver/remote/http/common.rb:88:in `new'
|
12
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/selenium-webdriver-3.142.4/lib/selenium/webdriver/remote/http/common.rb:88:in `create_response'
|
13
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/selenium-webdriver-3.142.4/lib/selenium/webdriver/remote/http/default.rb:114:in `request'
|
14
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/selenium-webdriver-3.142.4/lib/selenium/webdriver/remote/http/common.rb:64:in `call'
|
15
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/selenium-webdriver-3.142.4/lib/selenium/webdriver/remote/bridge.rb:167:in `execute'
|
16
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/selenium-webdriver-3.142.4/lib/selenium/webdriver/remote/bridge.rb:102:in `create_session'
|
17
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/selenium-webdriver-3.142.4/lib/selenium/webdriver/remote/bridge.rb:56:in `handshake'
|
18
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/selenium-webdriver-3.142.4/lib/selenium/webdriver/chrome/driver.rb:43:in `initialize'
|
19
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/selenium-webdriver-3.142.4/lib/selenium/webdriver/common/driver.rb:46:in `new'
|
20
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/selenium-webdriver-3.142.4/lib/selenium/webdriver/common/driver.rb:46:in `for'
|
21
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/selenium-webdriver-3.142.4/lib/selenium/webdriver.rb:88:in `for'
|
22
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/watir-6.16.5/lib/watir/browser.rb:46:in `initialize'
|
23
|
-
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/schema/editor.rb:110:in `new'
|
24
|
-
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/schema/editor.rb:110:in `open_browser_and_set_schema'
|
25
|
-
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/schema/editor.rb:37:in `block in start'
|
26
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run_machine'
|
27
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run'
|
28
|
-
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/schema/editor.rb:35:in `start'
|
29
|
-
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/tasks/main.rake:53:in `block (4 levels) in <top (required)>'
|
30
|
-
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/task_logging.rb:25:in `start'
|
31
|
-
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/tasks/main.rake:45:in `block (3 levels) in <top (required)>'
|
32
|
-
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/task_logging.rb:11:in `block in task'
|
33
|
-
/Users/yukihirop/RubyProjects/r2-oas/example-600/vendor/bundle/ruby/2.5.0/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
|
34
|
-
/Users/yukihirop/.rbenv/versions/2.5.3/bin/bundle:23:in `load'
|
35
|
-
/Users/yukihirop/.rbenv/versions/2.5.3/bin/bundle:23:in `<main>'
|
36
|
-
Tasks: TOP => routes:oas:editor
|
37
|
-
(See full trace by running task with --trace)
|
38
|
-
```
|
39
|
-
|
40
|
-
The solution is as follows
|
41
|
-
|
42
|
-
```bash
|
43
|
-
brew cask upgrade chromedriver
|
44
|
-
```
|