r2-oas 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +21 -0
- data/.travis.yml +3 -1
- data/CHANGELOG.md +15 -0
- data/GEMSPEC.md +23 -0
- data/Gemfile.lock +3 -1
- data/README.ja.md +2 -2
- data/README.md +2 -2
- data/docs/README.md +2 -2
- data/docs/index.html +1 -0
- data/docs/setting/configure.md +13 -0
- data/docs/usage/analyze_docs.md +14 -14
- data/docs/usage/deploy_docs.md +4 -4
- data/docs/usage/edit_docs.md +12 -12
- data/docs/usage/generate_docs.md +367 -211
- data/docs/usage/monitor_docs.md +16 -16
- data/docs/usage/use_hook_to_generate_docs.md +8 -8
- data/docs/usage/use_schema_namespace.md +30 -32
- data/docs/usage/use_tag_namespace.md +24 -26
- data/docs/usage/view_docs.md +16 -16
- data/lib/r2-oas.rb +1 -0
- data/lib/r2-oas/errors.rb +1 -0
- data/lib/r2-oas/lib/three-way-merge/twm.rb +83 -0
- data/lib/r2-oas/schema/builder.rb +23 -0
- data/lib/r2-oas/schema/generator.rb +1 -1
- data/lib/r2-oas/schema/manager/file_manager.rb +26 -0
- data/lib/r2-oas/schema/v3/analyzer/base_analyzer.rb +1 -6
- data/lib/r2-oas/schema/v3/builder.rb +28 -0
- data/lib/r2-oas/schema/v3/builder/base_builder.rb +60 -0
- data/lib/r2-oas/schema/v3/builder/doc_builder.rb +43 -0
- data/lib/r2-oas/schema/v3/generator.rb +1 -5
- data/lib/r2-oas/schema/v3/generator/base_generator.rb +30 -1
- data/lib/r2-oas/schema/v3/generator/components/object_generator.rb +6 -25
- data/lib/r2-oas/schema/v3/generator/components/request_body_generator.rb +6 -6
- data/lib/r2-oas/schema/v3/generator/doc_generator.rb +84 -19
- data/lib/r2-oas/schema/v3/generator/path_generator.rb +7 -19
- data/lib/r2-oas/schema/v3/generator/schema_generator.rb +5 -25
- data/lib/r2-oas/schema/v3/manager/file/base_file_manager.rb +3 -4
- data/lib/r2-oas/schema/v3/manager/pathname_manager.rb +6 -1
- data/lib/r2-oas/store.rb +118 -0
- data/lib/r2-oas/task_logging.rb +6 -0
- data/lib/r2-oas/tasks/main.rake +66 -73
- data/lib/r2-oas/tasks/tool.rake +25 -28
- data/lib/r2-oas/version.rb +1 -1
- data/r2-oas.gemspec +9 -2
- metadata +40 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bf20ae2c0c99f94558e59869340907ff824e3ae915ca75937c3b442239e3abe
|
4
|
+
data.tar.gz: 1b4c900930a1ea5450f233f7f03a627ff5ae7c6976d62a3c8ffbf3e5ed07bd22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdd920f94d39c3f0823c3aa6696f5ecb8d401808d3e0424115d2e8ac8758e052c50db3c2ac4ca6fd0b55fd44ab3b5d52ac175f3abacfab3e1c6adacdb1a58054
|
7
|
+
data.tar.gz: b01b1249e8fa3dc3de707783f33ff1720e96af0a85c5cd90e9877175419a143243bb6bbf6678f680af1a14af055ab87f3753c43d98903a4cca06cffd29b92055
|
data/.rubocop_todo.yml
CHANGED
@@ -26,6 +26,7 @@ Metrics/AbcSize:
|
|
26
26
|
- "lib/r2-oas/routing/components/request_component.rb"
|
27
27
|
- "spec/r2-oas/schema/v3/object/components/schema_object_spec.rb"
|
28
28
|
- "spec/support/helpers/config_helper.rb"
|
29
|
+
- "lib/r2-oas/schema/v3/generator/doc_generator.rb"
|
29
30
|
|
30
31
|
Style/Documentation:
|
31
32
|
Enabled: false
|
@@ -55,6 +56,7 @@ Metrics/BlockLength:
|
|
55
56
|
- "spec/r2-oas/tasks/tool_spec.rb"
|
56
57
|
- "spec/r2-oas/configuration_spec.rb"
|
57
58
|
- "spec/r2-oas/schema/v3/generator_spec.rb"
|
59
|
+
- "spec/r2-oas/schema/v3/builder_spec.rb"
|
58
60
|
- "spec/r2-oas/schema/v3/analyzer_spec.rb"
|
59
61
|
- "spec/support/helpers/config_helper.rb"
|
60
62
|
- "spec/r2-oas/schema/v3/object/components_object_spec.rb"
|
@@ -62,6 +64,7 @@ Metrics/BlockLength:
|
|
62
64
|
- "spec/r2-oas/schema/v3/manager/diff/base_array_diff_manager_spec.rb"
|
63
65
|
- "spec/r2-oas/schema/v3/manager/file/include_ref_base_file_manager_spec.rb"
|
64
66
|
- "spec/r2-oas/schema/v3/generator/base_generator_spec.rb"
|
67
|
+
- "spec/r2-oas/schema/v3/builder/base_builder_spec.rb"
|
65
68
|
- "spec/r2-oas/schema/v3/object/openapi_object_spec.rb"
|
66
69
|
- "spec/r2-oas/schema/v3/object/info_object_spec.rb"
|
67
70
|
|
@@ -112,17 +115,20 @@ Metrics/MethodLength:
|
|
112
115
|
- "lib/r2-oas/schema/v3/generator/schema_generator.rb"
|
113
116
|
- "lib/r2-oas/schema/v3/generator/components/schema_generator.rb"
|
114
117
|
- "lib/r2-oas/schema/v3/generator/doc_generator.rb"
|
118
|
+
- "lib/r2-oas/schema/v3/builder/doc_builder.rb"
|
115
119
|
- "lib/r2-oas/schema/v3/object/components/request_body_object.rb"
|
116
120
|
- "lib/r2-oas/schema/v3/squeezer/path_squeezer.rb"
|
117
121
|
- "lib/r2-oas/schema/v3/generator/components/object_generator.rb"
|
118
122
|
- "lib/r2-oas/routing/components/request_component.rb"
|
119
123
|
- "spec/support/helpers/config_helper.rb"
|
120
124
|
- "lib/r2-oas/schema/v3/analyzer/components/object_analyzer.rb"
|
125
|
+
- "lib/r2-oas/store.rb"
|
121
126
|
|
122
127
|
Metrics/CyclomaticComplexity:
|
123
128
|
Exclude:
|
124
129
|
- "lib/r2-oas/logger/stdout_logger.rb"
|
125
130
|
- "lib/r2-oas/schema/v3/manager/pathname_manager.rb"
|
131
|
+
- "lib/r2-oas/schema/v3/generator/doc_generator.rb"
|
126
132
|
|
127
133
|
Naming/ConstantName:
|
128
134
|
Exclude:
|
@@ -180,6 +186,7 @@ Style/AccessModifierDeclarations:
|
|
180
186
|
Style/NumericPredicate:
|
181
187
|
Exclude:
|
182
188
|
- "lib/r2-oas/schema/v3/generator/base_generator.rb"
|
189
|
+
- "lib/r2-oas/schema/v3/builder/base_builder.rb"
|
183
190
|
|
184
191
|
Metrics/ClassLength:
|
185
192
|
Exclude:
|
@@ -195,6 +202,7 @@ Layout/EndAlignment:
|
|
195
202
|
Exclude:
|
196
203
|
- "lib/r2-oas/shared/sortable.rb"
|
197
204
|
- "lib/r2-oas/schema/v3/generator/doc_generator.rb"
|
205
|
+
- "lib/r2-oas/schema/v3/builder/doc_builder.rb"
|
198
206
|
|
199
207
|
Security/YAMLLoad:
|
200
208
|
Exclude:
|
@@ -226,3 +234,16 @@ Lint/RequireParentheses:
|
|
226
234
|
Style/IfUnlessModifier:
|
227
235
|
Exclude:
|
228
236
|
- "lib/r2-oas/schema/editor.rb"
|
237
|
+
|
238
|
+
Security/MarshalLoad:
|
239
|
+
Enabled: false
|
240
|
+
|
241
|
+
Metrics/PerceivedComplexity:
|
242
|
+
Exclude:
|
243
|
+
- "lib/r2-oas/schema/v3/generator/doc_generator.rb"
|
244
|
+
|
245
|
+
Lint/UselessAssignment:
|
246
|
+
Enabled: false
|
247
|
+
|
248
|
+
Style/NestedParenthesizedCalls:
|
249
|
+
Enabled: false
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## v0.2.0
|
4
|
+
|
5
|
+
2020-05-02
|
6
|
+
|
7
|
+
- [`Feature/Breaking`] Upgrade `routes:oas:docs` cmd ([37ccddf](https://github.com/yukihirop/r2-oas/pull/117))
|
8
|
+
|
9
|
+
- `.docs` is needed to continue using r2-oas. `If you are using previous version`,you need to run the following command to generate `.docs`.
|
10
|
+
|
11
|
+
```bash
|
12
|
+
CACHE_DOCS=true bundle exec rake routes:oas:docs
|
13
|
+
```
|
14
|
+
|
15
|
+
- [`Breaking`] Divide into `Generator` and `Builder` ([00fea7d](https://github.com/yukihirop/r2-oas/pull/116))
|
16
|
+
- `routes:oas:docs` cmd do not generate `oas_docs/oas_doc.yml`
|
17
|
+
|
3
18
|
## v0.1.3
|
4
19
|
|
5
20
|
2020-04-27
|
data/GEMSPEC.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Let's intuitively write API documentation with Swagger Editor in your Rails Project! 😊
|
2
|
+
|
3
|
+
Configureless and no DSL. 👍 But you can also configure.
|
4
|
+
|
5
|
+
Loosely coupled to your Rails project. 👍
|
6
|
+
|
7
|
+
So If it doesn't, you can always stop easily. 😢
|
8
|
+
|
9
|
+
Generate api docment(OpenAPI) side only from `Rails` routing.
|
10
|
+
|
11
|
+
Provide rake tasks to management API Docment (OpenAPI) 🎉
|
12
|
+
|
13
|
+
|
14
|
+
$ bundle exec rake routes:oas:docs # generate
|
15
|
+
$ bundle exec rake routes:oas:ui # view
|
16
|
+
$ bundle exec rake routes:oas:editor # edit
|
17
|
+
$ bundle exec rake routes:oas:monitor # monitor
|
18
|
+
$ bundle exec rake routes:oas:dist # distribute
|
19
|
+
$ bundle exec rake routes:oas:clean # clean
|
20
|
+
$ bundle exec rake routes:oas:analyze # analyze
|
21
|
+
$ bundle exec rake routes:oas:deploy # deploy
|
22
|
+
|
23
|
+
Happy Coding ❗️
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
r2-oas (0.
|
4
|
+
r2-oas (0.2.0)
|
5
5
|
docker-api (~> 1.34.2)
|
6
6
|
easy_diff (~> 1.0.0)
|
7
7
|
eventmachine (~> 1.2.0)
|
8
|
+
key_flatten (~> 1.0.0)
|
8
9
|
paint
|
9
10
|
rails (>= 4.2.5)
|
10
11
|
terminal-table (~> 1.6.0)
|
@@ -95,6 +96,7 @@ GEM
|
|
95
96
|
concurrent-ruby (~> 1.0)
|
96
97
|
jaro_winkler (1.5.3)
|
97
98
|
json (2.2.0)
|
99
|
+
key_flatten (1.0.0)
|
98
100
|
loofah (2.5.0)
|
99
101
|
crass (~> 1.0.2)
|
100
102
|
nokogiri (>= 1.5.9)
|
data/README.ja.md
CHANGED
@@ -55,12 +55,12 @@ bundle exec routes:oas:editor
|
|
55
55
|
|
56
56
|
#### Generate docs
|
57
57
|
|
58
|
-
![oas_docs](https://user-images.githubusercontent.com/11146767/
|
58
|
+
![oas_docs](https://user-images.githubusercontent.com/11146767/80856236-0b839a80-8c83-11ea-888f-d0e659e0c251.gif)
|
59
59
|
|
60
60
|
|
61
61
|
#### Edit docs
|
62
62
|
|
63
|
-
![oas_editor](https://user-images.githubusercontent.com/11146767/
|
63
|
+
![oas_editor](https://user-images.githubusercontent.com/11146767/80856240-15a59900-8c83-11ea-9dbd-4382528944f2.gif)
|
64
64
|
|
65
65
|
## 📚 Documents
|
66
66
|
|
data/README.md
CHANGED
@@ -65,12 +65,12 @@ bundle exec routes:oas:editor
|
|
65
65
|
|
66
66
|
#### Generate docs
|
67
67
|
|
68
|
-
![oas_docs](https://user-images.githubusercontent.com/11146767/
|
68
|
+
![oas_docs](https://user-images.githubusercontent.com/11146767/80856236-0b839a80-8c83-11ea-888f-d0e659e0c251.gif)
|
69
69
|
|
70
70
|
|
71
71
|
#### Edit docs
|
72
72
|
|
73
|
-
![oas_editor](https://user-images.githubusercontent.com/11146767/
|
73
|
+
![oas_editor](https://user-images.githubusercontent.com/11146767/80856240-15a59900-8c83-11ea-9dbd-4382528944f2.gif)
|
74
74
|
|
75
75
|
## Usage
|
76
76
|
|
data/docs/README.md
CHANGED
@@ -65,12 +65,12 @@ bundle exec routes:oas:editor
|
|
65
65
|
|
66
66
|
#### Generate docs
|
67
67
|
|
68
|
-
![oas_docs](https://user-images.githubusercontent.com/11146767/
|
68
|
+
![oas_docs](https://user-images.githubusercontent.com/11146767/80856236-0b839a80-8c83-11ea-888f-d0e659e0c251.gif)
|
69
69
|
|
70
70
|
|
71
71
|
#### Edit docs
|
72
72
|
|
73
|
-
![oas_editor](https://user-images.githubusercontent.com/11146767/
|
73
|
+
![oas_editor](https://user-images.githubusercontent.com/11146767/80856240-15a59900-8c83-11ea-9dbd-4382528944f2.gif)
|
74
74
|
|
75
75
|
## 📖 Usage
|
76
76
|
|
data/docs/index.html
CHANGED
@@ -24,5 +24,6 @@
|
|
24
24
|
<script src="//unpkg.com/docsify/lib/plugins/emoji.min.js"></script>
|
25
25
|
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-ruby.min.js"></script>
|
26
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>
|
27
28
|
</body>
|
28
29
|
</html>
|
data/docs/setting/configure.md
CHANGED
@@ -146,6 +146,7 @@ We explain the environment variables that can be set.
|
|
146
146
|
|--------|-----------|-------|
|
147
147
|
|PATHS_FILE|Specify one paths file path|`""`|
|
148
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`|
|
149
150
|
|
150
151
|
|
151
152
|
## .paths
|
@@ -161,3 +162,15 @@ account.yml
|
|
161
162
|
account.yml # ignore
|
162
163
|
account.yml # ignore
|
163
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
|
+
```
|
data/docs/usage/analyze_docs.md
CHANGED
@@ -792,8 +792,8 @@ servers:
|
|
792
792
|
```
|
793
793
|
$ OAS_FILE=~/Desktop/swagger_file.yml be rake routes:oas:analyze
|
794
794
|
I, [2019-05-05T15:00:40.716815 #18669] INFO -- : [R2-OAS] start
|
795
|
-
I, [2019-05-05T15:00:40.756046 #18669] INFO -- : [Analyze
|
796
|
-
I, [2019-05-05T15:00:40.758453 #18669] INFO -- : [Analyze
|
795
|
+
I, [2019-05-05T15:00:40.756046 #18669] INFO -- : [Analyze OAS file] start
|
796
|
+
I, [2019-05-05T15:00:40.758453 #18669] INFO -- : [Analyze OAS file (paths)] start
|
797
797
|
I, [2019-05-05T15:00:40.763028 #18669] INFO -- : Write schema file: oas_docs/src/paths/user.yml
|
798
798
|
I, [2019-05-05T15:00:40.775377 #18669] INFO -- : Write schema file: oas_docs/src/paths/api/v1/task.yml
|
799
799
|
I, [2019-05-05T15:00:40.776937 #18669] INFO -- : Write schema file: oas_docs/src/paths/api/v1/post.yml
|
@@ -801,23 +801,23 @@ I, [2019-05-05T15:00:40.778774 #18669] INFO -- : Write schema file: oas_docs
|
|
801
801
|
I, [2019-05-05T15:00:40.780856 #18669] INFO -- : Write schema file: oas_docs/src/paths/task.yml
|
802
802
|
I, [2019-05-05T15:00:40.782192 #18669] INFO -- : Write schema file: oas_docs/src/paths/rails_admin/engine.yml
|
803
803
|
I, [2019-05-05T15:00:40.787576 #18669] INFO -- : Write schema file: oas_docs/src/paths/rails_admin/main.yml
|
804
|
-
I, [2019-05-05T15:00:40.787615 #18669] INFO -- : [Analyze
|
805
|
-
I, [2019-05-05T15:00:40.788014 #18669] INFO -- : [Analyze
|
804
|
+
I, [2019-05-05T15:00:40.787615 #18669] INFO -- : [Analyze OAS file (paths)] end
|
805
|
+
I, [2019-05-05T15:00:40.788014 #18669] INFO -- : [Analyze OAS file (tags)] start
|
806
806
|
I, [2019-05-05T15:00:40.788948 #18669] INFO -- : Write schema file: oas_docs/src/tags.yml
|
807
|
-
I, [2019-05-05T15:00:40.788972 #18669] INFO -- : [Analyze
|
808
|
-
I, [2019-05-05T15:00:40.788985 #18669] INFO -- : [Analyze
|
809
|
-
I, [2019-05-05T15:00:40.788999 #18669] INFO -- : [Analyze
|
807
|
+
I, [2019-05-05T15:00:40.788972 #18669] INFO -- : [Analyze OAS file (tags)] end
|
808
|
+
I, [2019-05-05T15:00:40.788985 #18669] INFO -- : [Analyze OAS file (components)] start
|
809
|
+
I, [2019-05-05T15:00:40.788999 #18669] INFO -- : [Analyze OAS file (components/schemas)] start
|
810
810
|
I, [2019-05-05T15:00:40.790696 #18669] INFO -- : Write schema file: oas_docs/src/components/schemas/user.yml
|
811
811
|
I, [2019-05-05T15:00:40.791151 #18669] INFO -- : Write schema file: oas_docs/src/components/schemas/task.yml
|
812
812
|
I, [2019-05-05T15:00:40.791635 #18669] INFO -- : Write schema file: oas_docs/src/components/schemas/engine.yml
|
813
813
|
I, [2019-05-05T15:00:40.792107 #18669] INFO -- : Write schema file: oas_docs/src/components/schemas/main.yml
|
814
814
|
I, [2019-05-05T15:00:40.792495 #18669] INFO -- : Write schema file: oas_docs/src/components/schemas/post.yml
|
815
|
-
I, [2019-05-05T15:00:40.792515 #18669] INFO -- : [Analyze
|
816
|
-
I, [2019-05-05T15:00:40.792526 #18669] INFO -- : [Analyze
|
817
|
-
I, [2019-05-05T15:00:40.793238 #18669] INFO -- : [Analyze
|
818
|
-
I, [2019-05-05T15:00:40.848054 #18669] INFO -- : [
|
819
|
-
I, [2019-05-05T15:00:40.848102 #18669] INFO -- : [
|
820
|
-
I, [2019-05-05T15:00:40.848115 #18669] INFO -- : [
|
815
|
+
I, [2019-05-05T15:00:40.792515 #18669] INFO -- : [Analyze OAS file (components/schemas)] end
|
816
|
+
I, [2019-05-05T15:00:40.792526 #18669] INFO -- : [Analyze OAS file (components)] end
|
817
|
+
I, [2019-05-05T15:00:40.793238 #18669] INFO -- : [Analyze OAS file] end
|
818
|
+
I, [2019-05-05T15:00:40.848054 #18669] INFO -- : [Build OAS schema files] start
|
819
|
+
I, [2019-05-05T15:00:40.848102 #18669] INFO -- : [Build OAS schema files] end
|
820
|
+
I, [2019-05-05T15:00:40.848115 #18669] INFO -- : [Build OAS docs from schema files] start
|
821
821
|
I, [2019-05-05T15:00:40.848612 #18669] INFO -- : Use schema file: oas_docs/src/openapi.yml
|
822
822
|
I, [2019-05-05T15:00:40.849247 #18669] INFO -- : Use schema file: oas_docs/src/paths/user.yml
|
823
823
|
I, [2019-05-05T15:00:40.850005 #18669] INFO -- : Use schema file: oas_docs/src/paths/api/v1/task.yml
|
@@ -835,7 +835,7 @@ I, [2019-05-05T15:00:40.854978 #18669] INFO -- : Use schema file: oas_docs/sr
|
|
835
835
|
I, [2019-05-05T15:00:40.855185 #18669] INFO -- : Use schema file: oas_docs/src/components/schemas/post.yml
|
836
836
|
I, [2019-05-05T15:00:40.855543 #18669] INFO -- : Use schema file: oas_docs/src/info.yml
|
837
837
|
I, [2019-05-05T15:00:40.855888 #18669] INFO -- : Use schema file: oas_docs/src/servers.yml
|
838
|
-
I, [2019-05-05T15:00:40.872235 #18669] INFO -- : [
|
838
|
+
I, [2019-05-05T15:00:40.872235 #18669] INFO -- : [Build OAS docs from schema files] end
|
839
839
|
I, [2019-05-05T15:00:40.872286 #18669] INFO -- : [R2-OAS] end
|
840
840
|
```
|
841
841
|
|
data/docs/usage/deploy_docs.md
CHANGED
@@ -791,9 +791,9 @@ servers:
|
|
791
791
|
```
|
792
792
|
$ be rake routes:oas:deploy
|
793
793
|
I, [2019-05-06T19:32:52.014417 #22431] INFO -- : [R2-OAS] start
|
794
|
-
I, [2019-05-06T19:32:52.075691 #22431] INFO -- : [
|
795
|
-
I, [2019-05-06T19:32:52.075731 #22431] INFO -- : [
|
796
|
-
I, [2019-05-06T19:32:52.075743 #22431] INFO -- : [
|
794
|
+
I, [2019-05-06T19:32:52.075691 #22431] INFO -- : [Build OAS schema files] start
|
795
|
+
I, [2019-05-06T19:32:52.075731 #22431] INFO -- : [Build OAS schema files] end
|
796
|
+
I, [2019-05-06T19:32:52.075743 #22431] INFO -- : [Build OAS docs from schema files] start
|
797
797
|
I, [2019-05-06T19:32:52.079267 #22431] INFO -- : Use schema file: oas_docs/src/openapi.yml
|
798
798
|
I, [2019-05-06T19:32:52.080334 #22431] INFO -- : Use schema file: oas_docs/src/paths/user.yml
|
799
799
|
I, [2019-05-06T19:32:52.081189 #22431] INFO -- : Use schema file: oas_docs/src/paths/api/v1/task.yml
|
@@ -811,7 +811,7 @@ I, [2019-05-06T19:32:52.088281 #22431] INFO -- : Use schema file: oas_docs/sr
|
|
811
811
|
I, [2019-05-06T19:32:52.088567 #22431] INFO -- : Use schema file: oas_docs/src/components/schemas/post.yml
|
812
812
|
I, [2019-05-06T19:32:52.088867 #22431] INFO -- : Use schema file: oas_docs/src/info.yml
|
813
813
|
I, [2019-05-06T19:32:52.089136 #22431] INFO -- : Use schema file: oas_docs/src/servers.yml
|
814
|
-
I, [2019-05-06T19:32:52.100673 #22431] INFO -- : [
|
814
|
+
I, [2019-05-06T19:32:52.100673 #22431] INFO -- : [Build OAS docs from schema files] end
|
815
815
|
I, [2019-05-06T19:32:52.133732 #22431] INFO -- : [R2-OAS] end
|
816
816
|
```
|
817
817
|
|
data/docs/usage/edit_docs.md
CHANGED
@@ -87,7 +87,7 @@ The editor starts up with the schema set.
|
|
87
87
|
```
|
88
88
|
I, [2019-04-07T19:24:44.832837 #33139] INFO -- : [R2-OAS] start
|
89
89
|
I, [2019-04-07T19:24:44.832980 #33139] INFO -- : [R2-OAS] start
|
90
|
-
I, [2019-04-07T19:24:44.941617 #33139] INFO -- : [
|
90
|
+
I, [2019-04-07T19:24:44.941617 #33139] INFO -- : [Build OAS schema files] start
|
91
91
|
I, [2019-04-07T19:24:44.941859 #33139] INFO -- : <From schema files>
|
92
92
|
I, [2019-04-07T19:24:44.943345 #33139] INFO -- : Fetch schema file: oas_docs/src/openapi.yml
|
93
93
|
I, [2019-04-07T19:24:44.944161 #33139] INFO -- : Fetch schema file: oas_docs/src/paths/user.yml
|
@@ -105,7 +105,7 @@ I, [2019-04-07T19:24:44.949694 #33139] INFO -- : <Update schema files>
|
|
105
105
|
I, [2019-04-07T19:24:44.950397 #33139] INFO -- : Merge schema file: oas_docs/src/openapi.yml
|
106
106
|
I, [2019-04-07T19:24:44.950846 #33139] INFO -- : Merge schema file: oas_docs/src/info.yml
|
107
107
|
I, [2019-04-07T19:24:44.951710 #33139] INFO -- : Merge schema file: oas_docs/src/tags.yml
|
108
|
-
I, [2019-04-07T19:24:44.951779 #33139] INFO -- : [
|
108
|
+
I, [2019-04-07T19:24:44.951779 #33139] INFO -- : [Build OAS schema files (paths)] start
|
109
109
|
I, [2019-04-07T19:24:44.980847 #33139] INFO -- : <From schema files>
|
110
110
|
I, [2019-04-07T19:24:44.981390 #33139] INFO -- : Fetch schema file: oas_docs/src/paths/user.yml
|
111
111
|
I, [2019-04-07T19:24:44.981742 #33139] INFO -- : Fetch schema file: oas_docs/src/paths/api/v1/task.yml
|
@@ -122,11 +122,11 @@ I, [2019-04-07T19:24:44.988493 #33139] INFO -- : Merge schema file: oas_docs
|
|
122
122
|
I, [2019-04-07T19:24:44.989595 #33139] INFO -- : Merge schema file: oas_docs/src/paths/task.yml
|
123
123
|
I, [2019-04-07T19:24:44.990660 #33139] INFO -- : Merge schema file: oas_docs/src/paths/user.yml
|
124
124
|
I, [2019-04-07T19:24:44.992520 #33139] INFO -- : Merge schema file: oas_docs/src/paths/rails_admin/main.yml
|
125
|
-
I, [2019-04-07T19:24:44.992553 #33139] INFO -- : [
|
125
|
+
I, [2019-04-07T19:24:44.992553 #33139] INFO -- : [Build OAS schema files (paths)] end
|
126
126
|
I, [2019-04-07T19:24:44.992863 #33139] INFO -- : Merge schema file: oas_docs/src/externalDocs.yml
|
127
127
|
I, [2019-04-07T19:24:44.993229 #33139] INFO -- : Merge schema file: oas_docs/src/servers.yml
|
128
|
-
I, [2019-04-07T19:24:44.993272 #33139] INFO -- : [
|
129
|
-
I, [2019-04-07T19:24:44.993311 #33139] INFO -- : [
|
128
|
+
I, [2019-04-07T19:24:44.993272 #33139] INFO -- : [Build OAS schema files] end
|
129
|
+
I, [2019-04-07T19:24:44.993311 #33139] INFO -- : [Build OAS docs from schema files] start
|
130
130
|
I, [2019-04-07T19:24:44.993774 #33139] INFO -- : Use schema file: oas_docs/src/openapi.yml
|
131
131
|
I, [2019-04-07T19:24:44.994197 #33139] INFO -- : Use schema file: oas_docs/src/paths/user.yml
|
132
132
|
I, [2019-04-07T19:24:44.994627 #33139] INFO -- : Use schema file: oas_docs/src/paths/api/v1/task.yml
|
@@ -139,7 +139,7 @@ I, [2019-04-07T19:24:44.996885 #33139] INFO -- : Use schema file: oas_docs/sr
|
|
139
139
|
I, [2019-04-07T19:24:44.997187 #33139] INFO -- : Use schema file: oas_docs/src/tags.yml
|
140
140
|
I, [2019-04-07T19:24:44.997401 #33139] INFO -- : Use schema file: oas_docs/src/info.yml
|
141
141
|
I, [2019-04-07T19:24:44.997522 #33139] INFO -- : Use schema file: oas_docs/src/servers.yml
|
142
|
-
I, [2019-04-07T19:24:45.003195 #33139] INFO -- : [
|
142
|
+
I, [2019-04-07T19:24:45.003195 #33139] INFO -- : [Build OAS docs from schema files] end
|
143
143
|
I, [2019-04-07T19:24:45.003223 #33139] INFO -- : [R2-OAS] end
|
144
144
|
|
145
145
|
wait for single trap ...
|
@@ -167,7 +167,7 @@ $ PATHS_FILE="../oas_docs/schema/paths/api/v1/task.yml" bundle exec rake routes:
|
|
167
167
|
```
|
168
168
|
I, [2019-04-07T19:48:40.140872 #34907] INFO -- : [R2-OAS] start
|
169
169
|
I, [2019-04-07T19:48:40.140990 #34907] INFO -- : [R2-OAS] start
|
170
|
-
I, [2019-04-07T19:48:40.252636 #34907] INFO -- : [
|
170
|
+
I, [2019-04-07T19:48:40.252636 #34907] INFO -- : [Build OAS schema files] start
|
171
171
|
I, [2019-04-07T19:48:40.252835 #34907] INFO -- : <From schema files>
|
172
172
|
I, [2019-04-07T19:48:40.253463 #34907] INFO -- : Fetch schema file: ../oas_docs/schema/paths/api/v1/task.yml
|
173
173
|
I, [2019-04-07T19:48:40.253587 #34907] INFO -- : Fetch schema file: oas_docs/src/openapi.yml
|
@@ -179,7 +179,7 @@ I, [2019-04-07T19:48:40.254522 #34907] INFO -- : <Update schema files>
|
|
179
179
|
I, [2019-04-07T19:48:40.255059 #34907] INFO -- : Merge schema file: oas_docs/src/openapi.yml
|
180
180
|
I, [2019-04-07T19:48:40.255565 #34907] INFO -- : Merge schema file: oas_docs/src/info.yml
|
181
181
|
I, [2019-04-07T19:48:40.256410 #34907] INFO -- : Merge schema file: oas_docs/src/tags.yml
|
182
|
-
I, [2019-04-07T19:48:40.256433 #34907] INFO -- : [
|
182
|
+
I, [2019-04-07T19:48:40.256433 #34907] INFO -- : [Build OAS schema files (paths)] start
|
183
183
|
I, [2019-04-07T19:48:40.287252 #34907] INFO -- : <From schema files>
|
184
184
|
I, [2019-04-07T19:48:40.288195 #34907] INFO -- : Fetch schema file: oas_docs/src/paths/api/v1/task.yml
|
185
185
|
I, [2019-04-07T19:48:40.288253 #34907] INFO -- : <Update schema files (paths)>
|
@@ -190,18 +190,18 @@ I, [2019-04-07T19:48:40.292277 #34907] INFO -- : Merge schema file: oas_docs
|
|
190
190
|
I, [2019-04-07T19:48:40.293109 #34907] INFO -- : Merge schema file: oas_docs/src/paths/task.yml
|
191
191
|
I, [2019-04-07T19:48:40.294190 #34907] INFO -- : Merge schema file: oas_docs/src/paths/user.yml
|
192
192
|
I, [2019-04-07T19:48:40.296321 #34907] INFO -- : Merge schema file: oas_docs/src/paths/rails_admin/main.yml
|
193
|
-
I, [2019-04-07T19:48:40.296357 #34907] INFO -- : [
|
193
|
+
I, [2019-04-07T19:48:40.296357 #34907] INFO -- : [Build OAS schema files (paths)] end
|
194
194
|
I, [2019-04-07T19:48:40.296651 #34907] INFO -- : Merge schema file: oas_docs/src/externalDocs.yml
|
195
195
|
I, [2019-04-07T19:48:40.297043 #34907] INFO -- : Merge schema file: oas_docs/src/servers.yml
|
196
|
-
I, [2019-04-07T19:48:40.297068 #34907] INFO -- : [
|
197
|
-
I, [2019-04-07T19:48:40.297093 #34907] INFO -- : [
|
196
|
+
I, [2019-04-07T19:48:40.297068 #34907] INFO -- : [Build OAS schema files] end
|
197
|
+
I, [2019-04-07T19:48:40.297093 #34907] INFO -- : [Build OAS docs from schema files] start
|
198
198
|
I, [2019-04-07T19:48:40.297631 #34907] INFO -- : Use schema file: ../oas_docs/schema/paths/api/v1/task.yml
|
199
199
|
I, [2019-04-07T19:48:40.297797 #34907] INFO -- : Use schema file: oas_docs/src/openapi.yml
|
200
200
|
I, [2019-04-07T19:48:40.297956 #34907] INFO -- : Use schema file: oas_docs/src/externalDocs.yml
|
201
201
|
I, [2019-04-07T19:48:40.298421 #34907] INFO -- : Use schema file: oas_docs/src/tags.yml
|
202
202
|
I, [2019-04-07T19:48:40.298720 #34907] INFO -- : Use schema file: oas_docs/src/info.yml
|
203
203
|
I, [2019-04-07T19:48:40.298994 #34907] INFO -- : Use schema file: oas_docs/src/servers.yml
|
204
|
-
I, [2019-04-07T19:48:40.302896 #34907] INFO -- : [
|
204
|
+
I, [2019-04-07T19:48:40.302896 #34907] INFO -- : [Build OAS docs from schema files] end
|
205
205
|
I, [2019-04-07T19:48:40.302938 #34907] INFO -- : [R2-OAS] end
|
206
206
|
|
207
207
|
wait for single trap ...
|
data/docs/usage/generate_docs.md
CHANGED
@@ -20,237 +20,393 @@ $ bundle exec rake routes:oas:docs
|
|
20
20
|
|
21
21
|
if there is routing like this:
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
PATCH /api/v1/posts/:id(.:format) api/v1/posts#update
|
41
|
-
PUT /api/v1/posts/:id(.:format) api/v1/posts#update
|
42
|
-
DELETE /api/v1/posts/:id(.:format) api/v1/posts#destroy
|
43
|
-
api_v1_tasks GET /api/v1/tasks(.:format) api/v1/tasks#index
|
44
|
-
POST /api/v1/tasks(.:format) api/v1/tasks#create
|
45
|
-
new_api_v1_task GET /api/v1/tasks/new(.:format) api/v1/tasks#new
|
46
|
-
edit_api_v1_task GET /api/v1/tasks/:id/edit(.:format) api/v1/tasks#edit
|
47
|
-
api_v1_task GET /api/v1/tasks/:id(.:format) api/v1/tasks#show
|
48
|
-
PATCH /api/v1/tasks/:id(.:format) api/v1/tasks#update
|
49
|
-
PUT /api/v1/tasks/:id(.:format) api/v1/tasks#update
|
50
|
-
DELETE /api/v1/tasks/:id(.:format) api/v1/tasks#destroy
|
51
|
-
tasks GET /tasks(.:format) tasks#index
|
52
|
-
POST /tasks(.:format) tasks#create
|
53
|
-
new_task GET /tasks/new(.:format) tasks#new
|
54
|
-
edit_task GET /tasks/:id/edit(.:format) tasks#edit
|
55
|
-
task GET /tasks/:id(.:format) tasks#show
|
56
|
-
PATCH /tasks/:id(.:format) tasks#update
|
57
|
-
PUT /tasks/:id(.:format) tasks#update
|
58
|
-
DELETE /tasks/:id(.:format) tasks#destroy
|
59
|
-
users GET /users(.:format) users#index
|
60
|
-
POST /users(.:format) users#create
|
61
|
-
new_user GET /users/new(.:format) users#new
|
62
|
-
edit_user GET /users/:id/edit(.:format) users#edit
|
63
|
-
user GET /users/:id(.:format) users#show
|
64
|
-
PATCH /users/:id(.:format) users#update
|
65
|
-
PUT /users/:id(.:format) users#update
|
66
|
-
DELETE /users/:id(.:format) users#destroy
|
67
|
-
|
68
|
-
Routes for RailsAdmin::Engine:
|
69
|
-
dashboard GET / rails_admin/main#dashboard
|
70
|
-
index GET|POST /:model_name(.:format) rails_admin/main#index
|
71
|
-
new GET|POST /:model_name/new(.:format) rails_admin/main#new
|
72
|
-
export GET|POST /:model_name/export(.:format) rails_admin/main#export
|
73
|
-
bulk_delete POST|DELETE /:model_name/bulk_delete(.:format) rails_admin/main#bulk_delete
|
74
|
-
bulk_action POST /:model_name/bulk_action(.:format) rails_admin/main#bulk_action
|
75
|
-
show GET /:model_name/:id(.:format) rails_admin/main#show
|
76
|
-
edit GET|PUT /:model_name/:id/edit(.:format) rails_admin/main#edit
|
77
|
-
delete GET|DELETE /:model_name/:id/delete(.:format) rails_admin/main#delete
|
78
|
-
show_in_app GET /:model_name/:id/show_in_app(.:format) rails_admin/main#show_in_app
|
23
|
+
|
24
|
+
[config/routes.rb]
|
25
|
+
```ruby
|
26
|
+
Rails.application.routes.draw do
|
27
|
+
namespace :api do
|
28
|
+
namespace :v2 do
|
29
|
+
resources :posts
|
30
|
+
end
|
31
|
+
end
|
32
|
+
namespace :api do
|
33
|
+
namespace :v1 do
|
34
|
+
resources :tasks
|
35
|
+
end
|
36
|
+
end
|
37
|
+
resources :users
|
38
|
+
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
39
|
+
end
|
79
40
|
```
|
80
41
|
|
81
42
|
#### First try
|
82
43
|
|
83
44
|
```
|
84
45
|
$ bundle exec rake routes:oas:docs
|
85
|
-
I, [
|
86
|
-
I, [
|
87
|
-
I, [
|
88
|
-
I, [
|
89
|
-
I, [
|
90
|
-
I, [
|
91
|
-
I, [
|
92
|
-
I, [
|
93
|
-
I, [
|
94
|
-
I, [
|
95
|
-
I, [
|
96
|
-
I, [
|
97
|
-
I, [
|
98
|
-
I, [
|
99
|
-
I, [
|
100
|
-
I, [
|
101
|
-
I, [
|
102
|
-
I, [
|
103
|
-
I, [
|
104
|
-
I, [
|
105
|
-
I, [
|
106
|
-
I, [
|
107
|
-
I, [
|
108
|
-
I, [
|
109
|
-
I, [
|
110
|
-
I, [
|
111
|
-
I, [
|
112
|
-
I, [
|
113
|
-
I, [
|
114
|
-
I, [
|
115
|
-
I, [
|
116
|
-
I, [
|
117
|
-
I, [
|
118
|
-
I, [
|
119
|
-
I, [
|
120
|
-
I, [
|
46
|
+
I, [2020-05-01T00:26:30.037255 #32948] INFO -- : [R2-OAS] start
|
47
|
+
I, [2020-05-01T00:26:30.672796 #32948] INFO -- : [Generate OAS schema files] start
|
48
|
+
I, [2020-05-01T00:26:30.672844 #32948] INFO -- : <From routes data>
|
49
|
+
I, [2020-05-01T00:26:30.672860 #32948] INFO -- : <Update schema files>
|
50
|
+
I, [2020-05-01T00:26:30.674709 #32948] INFO -- : Add schema file into store: oas_docs/src/openapi.yml
|
51
|
+
I, [2020-05-01T00:26:30.677510 #32948] INFO -- : Add schema file into store: oas_docs/src/info.yml
|
52
|
+
I, [2020-05-01T00:26:30.679245 #32948] INFO -- : Add schema file into store: oas_docs/src/tags.yml
|
53
|
+
I, [2020-05-01T00:26:30.679266 #32948] INFO -- : [Generate OAS schema files (paths)] start
|
54
|
+
I, [2020-05-01T00:26:30.733419 #32948] INFO -- : <From routes data>
|
55
|
+
I, [2020-05-01T00:26:30.733458 #32948] INFO -- : <Update schema files (paths)>
|
56
|
+
I, [2020-05-01T00:26:30.739675 #32948] INFO -- : Add schema file into store: oas_docs/src/paths/api/v1/task.yml
|
57
|
+
I, [2020-05-01T00:26:30.746521 #32948] INFO -- : Add schema file into store: oas_docs/src/paths/api/v2/post.yml
|
58
|
+
I, [2020-05-01T00:26:30.748522 #32948] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/blob.yml
|
59
|
+
I, [2020-05-01T00:26:30.750825 #32948] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/direct_upload.yml
|
60
|
+
I, [2020-05-01T00:26:30.753929 #32948] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/disk.yml
|
61
|
+
I, [2020-05-01T00:26:30.755903 #32948] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/representation.yml
|
62
|
+
I, [2020-05-01T00:26:30.761207 #32948] INFO -- : Add schema file into store: oas_docs/src/paths/user.yml
|
63
|
+
I, [2020-05-01T00:26:30.761230 #32948] INFO -- : [Generate OAS schema files (paths)] end
|
64
|
+
I, [2020-05-01T00:26:30.762215 #32948] INFO -- : Add schema file into store: oas_docs/src/external_docs.yml
|
65
|
+
I, [2020-05-01T00:26:30.763149 #32948] INFO -- : Add schema file into store: oas_docs/src/servers.yml
|
66
|
+
I, [2020-05-01T00:26:30.763188 #32948] INFO -- : [Generate OAS schema files (components)] start
|
67
|
+
I, [2020-05-01T00:26:30.866904 #32948] INFO -- : <From routes data>
|
68
|
+
I, [2020-05-01T00:26:30.866941 #32948] INFO -- : <Update Components schema files (components/schemas)>
|
69
|
+
I, [2020-05-01T00:26:30.868176 #32948] INFO -- : Add schema file into store: oas_docs/src/components/schemas/user.yml
|
70
|
+
I, [2020-05-01T00:26:30.869116 #32948] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/blob.yml
|
71
|
+
I, [2020-05-01T00:26:30.870156 #32948] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/direct_upload.yml
|
72
|
+
I, [2020-05-01T00:26:30.871289 #32948] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/disk.yml
|
73
|
+
I, [2020-05-01T00:26:30.872316 #32948] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/representation.yml
|
74
|
+
I, [2020-05-01T00:26:30.873301 #32948] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v1/task.yml
|
75
|
+
I, [2020-05-01T00:26:30.874282 #32948] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v2/post.yml
|
76
|
+
I, [2020-05-01T00:26:30.925057 #32948] INFO -- : <From routes data>
|
77
|
+
I, [2020-05-01T00:26:30.925096 #32948] INFO -- : <Update Components schema files (components/requestBodies)>
|
78
|
+
I, [2020-05-01T00:26:30.927746 #32948] INFO -- : Add schema file into store: oas_docs/src/components/schemas/user.yml
|
79
|
+
I, [2020-05-01T00:26:30.929966 #32948] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/direct_upload.yml
|
80
|
+
I, [2020-05-01T00:26:30.932245 #32948] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/disk.yml
|
81
|
+
I, [2020-05-01T00:26:30.934686 #32948] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v1/task.yml
|
82
|
+
I, [2020-05-01T00:26:30.937036 #32948] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v2/post.yml
|
83
|
+
I, [2020-05-01T00:26:30.994492 #32948] INFO -- : <From routes data>
|
84
|
+
I, [2020-05-01T00:26:30.994534 #32948] INFO -- : <Update Components schema files (components/securitySchemes)>
|
85
|
+
I, [2020-05-01T00:26:31.057864 #32948] INFO -- : <From routes data>
|
86
|
+
I, [2020-05-01T00:26:31.057907 #32948] INFO -- : <Update Components schema files (components/parameters)>
|
87
|
+
I, [2020-05-01T00:26:31.112288 #32948] INFO -- : <From routes data>
|
88
|
+
I, [2020-05-01T00:26:31.112324 #32948] INFO -- : <Update Components schema files (components/responses)>
|
89
|
+
I, [2020-05-01T00:26:31.168867 #32948] INFO -- : <From routes data>
|
90
|
+
I, [2020-05-01T00:26:31.168905 #32948] INFO -- : <Update Components schema files (components/examples)>
|
91
|
+
I, [2020-05-01T00:26:31.221234 #32948] INFO -- : <From routes data>
|
92
|
+
I, [2020-05-01T00:26:31.221311 #32948] INFO -- : <Update Components schema files (components/headers)>
|
93
|
+
I, [2020-05-01T00:26:31.278310 #32948] INFO -- : <From routes data>
|
94
|
+
I, [2020-05-01T00:26:31.278346 #32948] INFO -- : <Update Components schema files (components/links)>
|
95
|
+
I, [2020-05-01T00:26:31.332940 #32948] INFO -- : <From routes data>
|
96
|
+
I, [2020-05-01T00:26:31.333018 #32948] INFO -- : <Update Components schema files (components/callbacks)>
|
97
|
+
I, [2020-05-01T00:26:31.333037 #32948] INFO -- : [Generate OAS schema files (components)] end
|
98
|
+
I, [2020-05-01T00:26:31.335576 #32948] INFO -- : [Generate OAS docs] Update cache at ./oas_docs/.docs
|
99
|
+
I, [2020-05-01T00:26:31.335616 #32948] INFO -- : [Generate OAS schema files] end
|
100
|
+
I, [2020-05-01T00:26:31.335634 #32948] INFO -- : [R2-OAS] end
|
121
101
|
```
|
122
102
|
|
123
|
-
|
103
|
+
Generate like this:
|
124
104
|
|
125
105
|
```
|
126
|
-
$
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
I, [2019-03-17T16:54:49.603179 #46856] INFO -- : Use schema file: oas_docs/src/paths/task.yml
|
174
|
-
I, [2019-03-17T16:54:49.603416 #46856] INFO -- : Use schema file: oas_docs/src/paths/rails_admin/engine.yml
|
175
|
-
I, [2019-03-17T16:54:49.604173 #46856] INFO -- : Use schema file: oas_docs/src/paths/rails_admin/main.yml
|
176
|
-
I, [2019-03-17T16:54:49.604317 #46856] INFO -- : Use schema file: oas_docs/src/externalDocs.yml
|
177
|
-
I, [2019-03-17T16:54:49.604653 #46856] INFO -- : Use schema file: oas_docs/src/tags.yml
|
178
|
-
I, [2019-03-17T16:54:49.604875 #46856] INFO -- : Use schema file: oas_docs/src/info.yml
|
179
|
-
I, [2019-03-17T16:54:49.604996 #46856] INFO -- : Use schema file: oas_docs/src/servers.yml
|
180
|
-
I, [2019-03-17T16:54:49.611405 #46856] INFO -- : [Generate Swagger docs from schema files] end
|
181
|
-
I, [2019-03-17T16:54:49.611451 #46856] INFO -- : [R2-OAS] end
|
106
|
+
$ tree -a oas_docs
|
107
|
+
oas_docs
|
108
|
+
├── .docs
|
109
|
+
├── .paths
|
110
|
+
└── src
|
111
|
+
├── components
|
112
|
+
│ ├── requestBodies
|
113
|
+
│ │ ├── activestorage
|
114
|
+
│ │ │ ├── direct_upload.yml
|
115
|
+
│ │ │ └── disk.yml
|
116
|
+
│ │ ├── api
|
117
|
+
│ │ │ ├── v1
|
118
|
+
│ │ │ │ └── task.yml
|
119
|
+
│ │ │ └── v2
|
120
|
+
│ │ │ └── post.yml
|
121
|
+
│ │ └── user.yml
|
122
|
+
│ └── schemas
|
123
|
+
│ ├── activestorage
|
124
|
+
│ │ ├── blob.yml
|
125
|
+
│ │ ├── direct_upload.yml
|
126
|
+
│ │ ├── disk.yml
|
127
|
+
│ │ └── representation.yml
|
128
|
+
│ ├── api
|
129
|
+
│ │ ├── v1
|
130
|
+
│ │ │ └── task.yml
|
131
|
+
│ │ └── v2
|
132
|
+
│ │ └── post.yml
|
133
|
+
│ └── user.yml
|
134
|
+
├── external_docs.yml
|
135
|
+
├── info.yml
|
136
|
+
├── openapi.yml
|
137
|
+
├── paths
|
138
|
+
│ ├── active_storage
|
139
|
+
│ │ ├── blob.yml
|
140
|
+
│ │ ├── direct_upload.yml
|
141
|
+
│ │ ├── disk.yml
|
142
|
+
│ │ └── representation.yml
|
143
|
+
│ ├── api
|
144
|
+
│ │ ├── v1
|
145
|
+
│ │ │ └── task.yml
|
146
|
+
│ │ └── v2
|
147
|
+
│ │ └── post.yml
|
148
|
+
│ └── user.yml
|
149
|
+
├── servers.yml
|
150
|
+
└── tags.yml
|
151
|
+
|
152
|
+
17 directories, 26 files
|
182
153
|
```
|
183
154
|
|
184
|
-
|
155
|
+
#### Second Try (Change routes)
|
156
|
+
|
157
|
+
If routing changes like this:
|
185
158
|
|
159
|
+
```diff
|
160
|
+
Rails.application.routes.draw do
|
161
|
+
namespace :api do
|
162
|
+
namespace :v2 do
|
163
|
+
resources :posts
|
164
|
+
end
|
165
|
+
end
|
166
|
+
namespace :api do
|
167
|
+
namespace :v1 do
|
168
|
+
+ resources :tasks, only: [:index, :create]
|
169
|
+
- resources :tasks
|
170
|
+
end
|
171
|
+
end
|
172
|
+
resources :users
|
173
|
+
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
174
|
+
end
|
186
175
|
```
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
176
|
+
|
177
|
+
When the `bundle exec rake routes:oas:docs` command is executed in this state, it becomes as follows:
|
178
|
+
|
179
|
+
```
|
180
|
+
I, [2020-05-01T01:06:35.982655 #34660] INFO -- : [R2-OAS] start
|
181
|
+
I, [2020-05-01T01:06:36.508949 #34660] INFO -- : [Generate OAS schema files] start
|
182
|
+
I, [2020-05-01T01:06:36.509027 #34660] INFO -- : <From routes data>
|
183
|
+
I, [2020-05-01T01:06:36.509053 #34660] INFO -- : <Update schema files>
|
184
|
+
I, [2020-05-01T01:06:36.511900 #34660] INFO -- : Add schema file into store: oas_docs/src/openapi.yml
|
185
|
+
I, [2020-05-01T01:06:36.513213 #34660] INFO -- : Add schema file into store: oas_docs/src/info.yml
|
186
|
+
I, [2020-05-01T01:06:36.515045 #34660] INFO -- : Add schema file into store: oas_docs/src/tags.yml
|
187
|
+
I, [2020-05-01T01:06:36.515066 #34660] INFO -- : [Generate OAS schema files (paths)] start
|
188
|
+
I, [2020-05-01T01:06:36.572245 #34660] INFO -- : <From routes data>
|
189
|
+
I, [2020-05-01T01:06:36.572281 #34660] INFO -- : <Update schema files (paths)>
|
190
|
+
I, [2020-05-01T01:06:36.574396 #34660] INFO -- : Add schema file into store: oas_docs/src/paths/api/v1/task.yml
|
191
|
+
I, [2020-05-01T01:06:36.580388 #34660] INFO -- : Add schema file into store: oas_docs/src/paths/api/v2/post.yml
|
192
|
+
I, [2020-05-01T01:06:36.582187 #34660] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/blob.yml
|
193
|
+
I, [2020-05-01T01:06:36.583721 #34660] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/direct_upload.yml
|
194
|
+
I, [2020-05-01T01:06:36.585989 #34660] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/disk.yml
|
195
|
+
I, [2020-05-01T01:06:36.588352 #34660] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/representation.yml
|
196
|
+
I, [2020-05-01T01:06:36.594436 #34660] INFO -- : Add schema file into store: oas_docs/src/paths/user.yml
|
197
|
+
I, [2020-05-01T01:06:36.594470 #34660] INFO -- : [Generate OAS schema files (paths)] end
|
198
|
+
I, [2020-05-01T01:06:36.595590 #34660] INFO -- : Add schema file into store: oas_docs/src/external_docs.yml
|
199
|
+
I, [2020-05-01T01:06:36.596515 #34660] INFO -- : Add schema file into store: oas_docs/src/servers.yml
|
200
|
+
I, [2020-05-01T01:06:36.596534 #34660] INFO -- : [Generate OAS schema files (components)] start
|
201
|
+
I, [2020-05-01T01:06:36.717794 #34660] INFO -- : <From routes data>
|
202
|
+
I, [2020-05-01T01:06:36.717835 #34660] INFO -- : <Update Components schema files (components/schemas)>
|
203
|
+
I, [2020-05-01T01:06:36.718962 #34660] INFO -- : Add schema file into store: oas_docs/src/components/schemas/user.yml
|
204
|
+
I, [2020-05-01T01:06:36.719937 #34660] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/blob.yml
|
205
|
+
I, [2020-05-01T01:06:36.720934 #34660] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/direct_upload.yml
|
206
|
+
I, [2020-05-01T01:06:36.722095 #34660] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/disk.yml
|
207
|
+
I, [2020-05-01T01:06:36.723164 #34660] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/representation.yml
|
208
|
+
I, [2020-05-01T01:06:36.724655 #34660] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v1/task.yml
|
209
|
+
I, [2020-05-01T01:06:36.725850 #34660] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v2/post.yml
|
210
|
+
I, [2020-05-01T01:06:36.777317 #34660] INFO -- : <From routes data>
|
211
|
+
I, [2020-05-01T01:06:36.777355 #34660] INFO -- : <Update Components schema files (components/requestBodies)>
|
212
|
+
I, [2020-05-01T01:06:36.779647 #34660] INFO -- : Add schema file into store: oas_docs/src/components/schemas/user.yml
|
213
|
+
I, [2020-05-01T01:06:36.782242 #34660] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/direct_upload.yml
|
214
|
+
I, [2020-05-01T01:06:36.784386 #34660] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/disk.yml
|
215
|
+
I, [2020-05-01T01:06:36.786612 #34660] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v1/task.yml
|
216
|
+
I, [2020-05-01T01:06:36.788868 #34660] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v2/post.yml
|
217
|
+
I, [2020-05-01T01:06:36.841673 #34660] INFO -- : <From routes data>
|
218
|
+
I, [2020-05-01T01:06:36.841712 #34660] INFO -- : <Update Components schema files (components/securitySchemes)>
|
219
|
+
I, [2020-05-01T01:06:36.893801 #34660] INFO -- : <From routes data>
|
220
|
+
I, [2020-05-01T01:06:36.893842 #34660] INFO -- : <Update Components schema files (components/parameters)>
|
221
|
+
I, [2020-05-01T01:06:36.948128 #34660] INFO -- : <From routes data>
|
222
|
+
I, [2020-05-01T01:06:36.948166 #34660] INFO -- : <Update Components schema files (components/responses)>
|
223
|
+
I, [2020-05-01T01:06:37.000992 #34660] INFO -- : <From routes data>
|
224
|
+
I, [2020-05-01T01:06:37.001030 #34660] INFO -- : <Update Components schema files (components/examples)>
|
225
|
+
I, [2020-05-01T01:06:37.053304 #34660] INFO -- : <From routes data>
|
226
|
+
I, [2020-05-01T01:06:37.053342 #34660] INFO -- : <Update Components schema files (components/headers)>
|
227
|
+
I, [2020-05-01T01:06:37.109044 #34660] INFO -- : <From routes data>
|
228
|
+
I, [2020-05-01T01:06:37.109082 #34660] INFO -- : <Update Components schema files (components/links)>
|
229
|
+
I, [2020-05-01T01:06:37.159305 #34660] INFO -- : <From routes data>
|
230
|
+
I, [2020-05-01T01:06:37.159343 #34660] INFO -- : <Update Components schema files (components/callbacks)>
|
231
|
+
I, [2020-05-01T01:06:37.159354 #34660] INFO -- : [Generate OAS schema files (components)] end
|
232
|
+
I, [2020-05-01T01:06:37.160924 #34660] INFO -- : Delete schema file: oas_docs/src/paths/api/v1/task.yml
|
233
|
+
I, [2020-05-01T01:06:37.161753 #34660] INFO -- : Write schema file: oas_docs/src/paths/api/v1/task.yml
|
234
|
+
I, [2020-05-01T01:06:37.162357 #34660] INFO -- : [Generate OAS docs] Update cache at ./oas_docs/.docs
|
235
|
+
I, [2020-05-01T01:06:37.162374 #34660] INFO -- : [Generate OAS schema files] end
|
236
|
+
I, [2020-05-01T01:06:37.162386 #34660] INFO -- : [R2-OAS] end
|
207
237
|
```
|
208
238
|
|
209
|
-
|
239
|
+
The file is updated by the route deleted in this way. The behavior will be the same when adding.
|
210
240
|
|
211
|
-
|
212
|
-
|
241
|
+
## Create Cache Docs [Important]
|
242
|
+
|
243
|
+
It is a function of `v0.1.4` or later that the `.docs` file is generated when the `bundle exec rake routes:oas:docs` command is executed, so those who have used it before that need to hit the following command to create the` .docs` file.
|
213
244
|
|
214
245
|
```bash
|
215
|
-
|
246
|
+
CACHE_DOCS=true bundle exec rake routes:oas:docs
|
216
247
|
```
|
217
248
|
|
249
|
+
Create the cache information of API document with reference to the current information of `config/routes.rb`. Files under `src/**/**.yml` are not affected
|
250
|
+
|
251
|
+
<details>
|
252
|
+
|
253
|
+
```
|
254
|
+
$ CACHE_DOCS=true bundle exec rake routes:oas:docs
|
255
|
+
I, [2020-05-01T01:31:23.512339 #38857] INFO -- : [R2-OAS] start
|
256
|
+
I, [2020-05-01T01:31:24.103471 #38857] INFO -- : [Generate OAS schema files] start
|
257
|
+
I, [2020-05-01T01:31:24.103509 #38857] INFO -- : <From routes data>
|
258
|
+
I, [2020-05-01T01:31:24.103546 #38857] INFO -- : <Update schema files>
|
259
|
+
I, [2020-05-01T01:31:24.106149 #38857] INFO -- : Add schema file into store: oas_docs/src/openapi.yml
|
260
|
+
I, [2020-05-01T01:31:24.108049 #38857] INFO -- : Add schema file into store: oas_docs/src/info.yml
|
261
|
+
I, [2020-05-01T01:31:24.110170 #38857] INFO -- : Add schema file into store: oas_docs/src/tags.yml
|
262
|
+
I, [2020-05-01T01:31:24.110190 #38857] INFO -- : [Generate OAS schema files (paths)] start
|
263
|
+
I, [2020-05-01T01:31:24.161252 #38857] INFO -- : <From routes data>
|
264
|
+
I, [2020-05-01T01:31:24.161307 #38857] INFO -- : <Update schema files (paths)>
|
265
|
+
I, [2020-05-01T01:31:24.168345 #38857] INFO -- : Add schema file into store: oas_docs/src/paths/api/v1/task.yml
|
266
|
+
I, [2020-05-01T01:31:24.174644 #38857] INFO -- : Add schema file into store: oas_docs/src/paths/api/v2/post.yml
|
267
|
+
I, [2020-05-01T01:31:24.177262 #38857] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/blob.yml
|
268
|
+
I, [2020-05-01T01:31:24.179036 #38857] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/direct_upload.yml
|
269
|
+
I, [2020-05-01T01:31:24.182049 #38857] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/disk.yml
|
270
|
+
I, [2020-05-01T01:31:24.184352 #38857] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/representation.yml
|
271
|
+
I, [2020-05-01T01:31:24.191103 #38857] INFO -- : Add schema file into store: oas_docs/src/paths/user.yml
|
272
|
+
I, [2020-05-01T01:31:24.191138 #38857] INFO -- : [Generate OAS schema files (paths)] end
|
273
|
+
I, [2020-05-01T01:31:24.192176 #38857] INFO -- : Add schema file into store: oas_docs/src/external_docs.yml
|
274
|
+
I, [2020-05-01T01:31:24.193420 #38857] INFO -- : Add schema file into store: oas_docs/src/servers.yml
|
275
|
+
I, [2020-05-01T01:31:24.193439 #38857] INFO -- : [Generate OAS schema files (components)] start
|
276
|
+
I, [2020-05-01T01:31:24.284912 #38857] INFO -- : <From routes data>
|
277
|
+
I, [2020-05-01T01:31:24.284948 #38857] INFO -- : <Update Components schema files (components/schemas)>
|
278
|
+
I, [2020-05-01T01:31:24.285956 #38857] INFO -- : Add schema file into store: oas_docs/src/components/schemas/user.yml
|
279
|
+
I, [2020-05-01T01:31:24.287138 #38857] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/blob.yml
|
280
|
+
I, [2020-05-01T01:31:24.288612 #38857] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/direct_upload.yml
|
281
|
+
I, [2020-05-01T01:31:24.289710 #38857] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/disk.yml
|
282
|
+
I, [2020-05-01T01:31:24.290637 #38857] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/representation.yml
|
283
|
+
I, [2020-05-01T01:31:24.291558 #38857] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v1/task.yml
|
284
|
+
I, [2020-05-01T01:31:24.292834 #38857] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v2/post.yml
|
285
|
+
I, [2020-05-01T01:31:24.409634 #38857] INFO -- : <From routes data>
|
286
|
+
I, [2020-05-01T01:31:24.409687 #38857] INFO -- : <Update Components schema files (components/requestBodies)>
|
287
|
+
I, [2020-05-01T01:31:24.412535 #38857] INFO -- : Add schema file into store: oas_docs/src/components/schemas/user.yml
|
288
|
+
I, [2020-05-01T01:31:24.415665 #38857] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/direct_upload.yml
|
289
|
+
I, [2020-05-01T01:31:24.418540 #38857] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/disk.yml
|
290
|
+
I, [2020-05-01T01:31:24.420598 #38857] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v1/task.yml
|
291
|
+
I, [2020-05-01T01:31:24.423222 #38857] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v2/post.yml
|
292
|
+
I, [2020-05-01T01:31:24.470555 #38857] INFO -- : <From routes data>
|
293
|
+
I, [2020-05-01T01:31:24.470597 #38857] INFO -- : <Update Components schema files (components/securitySchemes)>
|
294
|
+
I, [2020-05-01T01:31:24.522482 #38857] INFO -- : <From routes data>
|
295
|
+
I, [2020-05-01T01:31:24.522609 #38857] INFO -- : <Update Components schema files (components/parameters)>
|
296
|
+
I, [2020-05-01T01:31:24.569569 #38857] INFO -- : <From routes data>
|
297
|
+
I, [2020-05-01T01:31:24.569644 #38857] INFO -- : <Update Components schema files (components/responses)>
|
298
|
+
I, [2020-05-01T01:31:24.618008 #38857] INFO -- : <From routes data>
|
299
|
+
I, [2020-05-01T01:31:24.618045 #38857] INFO -- : <Update Components schema files (components/examples)>
|
300
|
+
I, [2020-05-01T01:31:24.663136 #38857] INFO -- : <From routes data>
|
301
|
+
I, [2020-05-01T01:31:24.663172 #38857] INFO -- : <Update Components schema files (components/headers)>
|
302
|
+
I, [2020-05-01T01:31:24.712207 #38857] INFO -- : <From routes data>
|
303
|
+
I, [2020-05-01T01:31:24.712244 #38857] INFO -- : <Update Components schema files (components/links)>
|
304
|
+
I, [2020-05-01T01:31:24.760286 #38857] INFO -- : <From routes data>
|
305
|
+
I, [2020-05-01T01:31:24.760322 #38857] INFO -- : <Update Components schema files (components/callbacks)>
|
306
|
+
I, [2020-05-01T01:31:24.760333 #38857] INFO -- : [Generate OAS schema files (components)] end
|
307
|
+
I, [2020-05-01T01:31:24.760948 #38857] INFO -- : [Generate OAS docs] Create cache at ./oas_docs/.docs
|
308
|
+
I, [2020-05-01T01:31:24.760966 #38857] INFO -- : [Generate OAS schema files] end
|
309
|
+
I, [2020-05-01T01:31:24.761044 #38857] INFO -- : [R2-OAS] end
|
218
310
|
```
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
I, [
|
239
|
-
I, [
|
240
|
-
I, [
|
241
|
-
I, [
|
242
|
-
I, [
|
243
|
-
I, [
|
244
|
-
I, [
|
245
|
-
I, [
|
246
|
-
I, [
|
247
|
-
I, [
|
248
|
-
I, [
|
249
|
-
I, [
|
250
|
-
I, [
|
251
|
-
I, [
|
252
|
-
I, [
|
253
|
-
I, [
|
254
|
-
I, [
|
255
|
-
I, [
|
311
|
+
|
312
|
+
</details>
|
313
|
+
|
314
|
+
If you run the `bundle exec rake routes:oas:docs` command without the `.docs` file, an error will occur.
|
315
|
+
|
316
|
+
```
|
317
|
+
rake aborted!
|
318
|
+
R2OAS::NoFileExistsError:
|
319
|
+
Can't find the file ./oas_docs/.docs
|
320
|
+
Please execute the following command to create ./oas_docs/.docs
|
321
|
+
|
322
|
+
CACHE_DOCS=true bundle exec rake routes:oas:docs
|
323
|
+
```
|
324
|
+
|
325
|
+
|
326
|
+
<details>
|
327
|
+
|
328
|
+
```
|
329
|
+
$ bundle exec rake routes:oas:docs
|
330
|
+
I, [2020-05-01T02:24:11.823975 #47636] INFO -- : [R2-OAS] start
|
331
|
+
I, [2020-05-01T02:24:12.337130 #47636] INFO -- : [Generate OAS schema files] start
|
332
|
+
I, [2020-05-01T02:24:12.337177 #47636] INFO -- : <From routes data>
|
333
|
+
I, [2020-05-01T02:24:12.337189 #47636] INFO -- : <Update schema files>
|
334
|
+
I, [2020-05-01T02:24:12.339013 #47636] INFO -- : Add schema file into store: oas_docs/src/openapi.yml
|
335
|
+
I, [2020-05-01T02:24:12.340182 #47636] INFO -- : Add schema file into store: oas_docs/src/info.yml
|
336
|
+
I, [2020-05-01T02:24:12.341872 #47636] INFO -- : Add schema file into store: oas_docs/src/tags.yml
|
337
|
+
I, [2020-05-01T02:24:12.341890 #47636] INFO -- : [Generate OAS schema files (paths)] start
|
338
|
+
I, [2020-05-01T02:24:12.391772 #47636] INFO -- : <From routes data>
|
339
|
+
I, [2020-05-01T02:24:12.391817 #47636] INFO -- : <Update schema files (paths)>
|
340
|
+
I, [2020-05-01T02:24:12.393787 #47636] INFO -- : Add schema file into store: oas_docs/src/paths/api/v1/task.yml
|
341
|
+
I, [2020-05-01T02:24:12.400245 #47636] INFO -- : Add schema file into store: oas_docs/src/paths/api/v2/post.yml
|
342
|
+
I, [2020-05-01T02:24:12.401931 #47636] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/blob.yml
|
343
|
+
I, [2020-05-01T02:24:12.403456 #47636] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/direct_upload.yml
|
344
|
+
I, [2020-05-01T02:24:12.405666 #47636] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/disk.yml
|
345
|
+
I, [2020-05-01T02:24:12.408723 #47636] INFO -- : Add schema file into store: oas_docs/src/paths/active_storage/representation.yml
|
346
|
+
I, [2020-05-01T02:24:12.417412 #47636] INFO -- : Add schema file into store: oas_docs/src/paths/user.yml
|
347
|
+
I, [2020-05-01T02:24:12.417509 #47636] INFO -- : [Generate OAS schema files (paths)] end
|
348
|
+
I, [2020-05-01T02:24:12.420108 #47636] INFO -- : Add schema file into store: oas_docs/src/external_docs.yml
|
349
|
+
I, [2020-05-01T02:24:12.421518 #47636] INFO -- : Add schema file into store: oas_docs/src/servers.yml
|
350
|
+
I, [2020-05-01T02:24:12.421539 #47636] INFO -- : [Generate OAS schema files (components)] start
|
351
|
+
I, [2020-05-01T02:24:12.516931 #47636] INFO -- : <From routes data>
|
352
|
+
I, [2020-05-01T02:24:12.516967 #47636] INFO -- : <Update Components schema files (components/schemas)>
|
353
|
+
I, [2020-05-01T02:24:12.518440 #47636] INFO -- : Add schema file into store: oas_docs/src/components/schemas/user.yml
|
354
|
+
I, [2020-05-01T02:24:12.519569 #47636] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/blob.yml
|
355
|
+
I, [2020-05-01T02:24:12.520535 #47636] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/direct_upload.yml
|
356
|
+
I, [2020-05-01T02:24:12.521450 #47636] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/disk.yml
|
357
|
+
I, [2020-05-01T02:24:12.522427 #47636] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/representation.yml
|
358
|
+
I, [2020-05-01T02:24:12.523469 #47636] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v1/task.yml
|
359
|
+
I, [2020-05-01T02:24:12.524670 #47636] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v2/post.yml
|
360
|
+
I, [2020-05-01T02:24:12.576654 #47636] INFO -- : <From routes data>
|
361
|
+
I, [2020-05-01T02:24:12.576697 #47636] INFO -- : <Update Components schema files (components/requestBodies)>
|
362
|
+
I, [2020-05-01T02:24:12.580611 #47636] INFO -- : Add schema file into store: oas_docs/src/components/schemas/user.yml
|
363
|
+
I, [2020-05-01T02:24:12.582940 #47636] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/direct_upload.yml
|
364
|
+
I, [2020-05-01T02:24:12.585316 #47636] INFO -- : Add schema file into store: oas_docs/src/components/schemas/activestorage/disk.yml
|
365
|
+
I, [2020-05-01T02:24:12.587631 #47636] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v1/task.yml
|
366
|
+
I, [2020-05-01T02:24:12.589786 #47636] INFO -- : Add schema file into store: oas_docs/src/components/schemas/api/v2/post.yml
|
367
|
+
I, [2020-05-01T02:24:12.650356 #47636] INFO -- : <From routes data>
|
368
|
+
I, [2020-05-01T02:24:12.650394 #47636] INFO -- : <Update Components schema files (components/securitySchemes)>
|
369
|
+
I, [2020-05-01T02:24:12.710266 #47636] INFO -- : <From routes data>
|
370
|
+
I, [2020-05-01T02:24:12.710302 #47636] INFO -- : <Update Components schema files (components/parameters)>
|
371
|
+
I, [2020-05-01T02:24:12.760227 #47636] INFO -- : <From routes data>
|
372
|
+
I, [2020-05-01T02:24:12.760265 #47636] INFO -- : <Update Components schema files (components/responses)>
|
373
|
+
I, [2020-05-01T02:24:12.818019 #47636] INFO -- : <From routes data>
|
374
|
+
I, [2020-05-01T02:24:12.818056 #47636] INFO -- : <Update Components schema files (components/examples)>
|
375
|
+
I, [2020-05-01T02:24:12.867610 #47636] INFO -- : <From routes data>
|
376
|
+
I, [2020-05-01T02:24:12.867649 #47636] INFO -- : <Update Components schema files (components/headers)>
|
377
|
+
I, [2020-05-01T02:24:12.921801 #47636] INFO -- : <From routes data>
|
378
|
+
I, [2020-05-01T02:24:12.921836 #47636] INFO -- : <Update Components schema files (components/links)>
|
379
|
+
I, [2020-05-01T02:24:12.971004 #47636] INFO -- : <From routes data>
|
380
|
+
I, [2020-05-01T02:24:12.971040 #47636] INFO -- : <Update Components schema files (components/callbacks)>
|
381
|
+
I, [2020-05-01T02:24:12.971052 #47636] INFO -- : [Generate OAS schema files (components)] end
|
382
|
+
rake aborted!
|
383
|
+
R2OAS::NoFileExistsError:
|
384
|
+
Can't find the file ./oas_docs/.docs
|
385
|
+
Please execute the following command to create ./oas_docs/.docs
|
386
|
+
|
387
|
+
CACHE_DOCS=true bundle exec rake routes:oas:docs
|
388
|
+
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/schema/v3/generator/doc_generator.rb:73:in `save_diff_schemas_from'
|
389
|
+
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/schema/v3/generator/doc_generator.rb:28:in `save_schemas_from_store'
|
390
|
+
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/schema/v3/generator/doc_generator.rb:20:in `generate_docs'
|
391
|
+
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/tasks/main.rake:17:in `block (4 levels) in <top (required)>'
|
392
|
+
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/task_logging.rb:25:in `start'
|
393
|
+
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/tasks/main.rake:13:in `block (3 levels) in <top (required)>'
|
394
|
+
/Users/yukihirop/RubyProjects/r2-oas/lib/r2-oas/task_logging.rb:11:in `block in task'
|
395
|
+
/Users/yukihirop/RubyProjects/r2-oas/example-523/vendor/bundle/ruby/2.3.0/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
|
396
|
+
/Users/yukihirop/.rbenv/versions/2.3.3/bin/bundle:22:in `load'
|
397
|
+
/Users/yukihirop/.rbenv/versions/2.3.3/bin/bundle:22:in `<main>'
|
398
|
+
Tasks: TOP => routes:oas:docs
|
399
|
+
(See full trace by running task with --trace)
|
400
|
+
```
|
401
|
+
|
402
|
+
</details>
|
403
|
+
|
404
|
+
## If you want to inspect .docs
|
405
|
+
|
406
|
+
You can check it by entering the following code with `pry` or something.
|
407
|
+
|
408
|
+
```ruby
|
409
|
+
result = IO.binread("oas_docs/.docs")
|
410
|
+
inflate = Zlib::Inflate.inflate(result)
|
411
|
+
puts Marshal.load(inflate)
|
256
412
|
```
|