r2-oas 0.1.2 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/.rubocop.yml +6 -3
  4. data/.rubocop_todo.yml +68 -1
  5. data/.travis.yml +6 -2
  6. data/Appraisals +13 -0
  7. data/CHANGELOG.md +51 -0
  8. data/GEMSPEC.md +20 -0
  9. data/README.ja.md +71 -0
  10. data/README.md +70 -0
  11. data/lib/r2-oas.rb +3 -4
  12. data/lib/r2-oas/deploy/client.rb +33 -6
  13. data/lib/r2-oas/errors.rb +1 -0
  14. data/lib/r2-oas/lib/core_ext/hash/deep_merge.rb +44 -0
  15. data/lib/r2-oas/lib/core_ext/object/blank.rb +135 -0
  16. data/lib/r2-oas/lib/three-way-merge/twm.rb +83 -0
  17. data/lib/r2-oas/schema/builder.rb +23 -0
  18. data/lib/r2-oas/schema/editor.rb +26 -7
  19. data/lib/r2-oas/schema/generator.rb +1 -1
  20. data/lib/r2-oas/schema/manager/file_manager.rb +26 -0
  21. data/lib/r2-oas/schema/ui.rb +0 -1
  22. data/lib/r2-oas/schema/v3/analyzer/base_analyzer.rb +1 -6
  23. data/lib/r2-oas/schema/v3/analyzer/components/object_analyzer.rb +1 -1
  24. data/lib/r2-oas/schema/v3/analyzer/path_analyzer.rb +1 -1
  25. data/lib/r2-oas/schema/v3/analyzer/tag_analyzer.rb +1 -1
  26. data/lib/r2-oas/schema/v3/builder.rb +28 -0
  27. data/lib/r2-oas/schema/v3/builder/base_builder.rb +60 -0
  28. data/lib/r2-oas/schema/v3/builder/doc_builder.rb +43 -0
  29. data/lib/r2-oas/schema/v3/cleaner/base_cleaner.rb +1 -1
  30. data/lib/r2-oas/schema/v3/generator.rb +1 -5
  31. data/lib/r2-oas/schema/v3/generator/base_generator.rb +30 -1
  32. data/lib/r2-oas/schema/v3/generator/components/object_generator.rb +6 -25
  33. data/lib/r2-oas/schema/v3/generator/components/request_body_generator.rb +6 -6
  34. data/lib/r2-oas/schema/v3/generator/doc_generator.rb +84 -18
  35. data/lib/r2-oas/schema/v3/generator/path_generator.rb +7 -19
  36. data/lib/r2-oas/schema/v3/generator/schema_generator.rb +6 -26
  37. data/lib/r2-oas/schema/v3/manager/file/base_file_manager.rb +10 -4
  38. data/lib/r2-oas/schema/v3/manager/pathname_manager.rb +6 -1
  39. data/lib/r2-oas/store.rb +118 -0
  40. data/lib/r2-oas/task_logging.rb +6 -0
  41. data/lib/r2-oas/tasks/main.rake +66 -73
  42. data/lib/r2-oas/tasks/tool.rake +32 -28
  43. data/lib/r2-oas/tool/paths/ls.rb +1 -1
  44. data/lib/r2-oas/version.rb +1 -1
  45. data/r2-oas.gemspec +19 -10
  46. metadata +88 -60
  47. data/.github/ISSUE_TEMPLATE.md +0 -12
  48. data/.github/PULL_REQUEST_TEMPLATE.md +0 -12
  49. data/Gemfile.lock +0 -222
  50. data/bin/console +0 -12
  51. data/bin/setup +0 -8
  52. data/docs/.nojekyll +0 -0
  53. data/docs/README.md +0 -326
  54. data/docs/_sidebar.md +0 -22
  55. data/docs/index.html +0 -28
  56. data/docs/schema/3.0.0.md +0 -155
  57. data/docs/setting/COC.md +0 -14
  58. data/docs/setting/CORS.md +0 -22
  59. data/docs/setting/configure.md +0 -163
  60. data/docs/usage/analyze_docs.md +0 -875
  61. data/docs/usage/clean_docs.md +0 -19
  62. data/docs/usage/deploy_docs.md +0 -839
  63. data/docs/usage/display_paths_list.md +0 -35
  64. data/docs/usage/display_paths_stats.md +0 -54
  65. data/docs/usage/edit_docs.md +0 -218
  66. data/docs/usage/generate_docs.md +0 -256
  67. data/docs/usage/monitor_docs.md +0 -219
  68. data/docs/usage/use_hook_methods.md +0 -236
  69. data/docs/usage/use_hook_to_generate_docs.md +0 -235
  70. data/docs/usage/use_schema_namespace.md +0 -183
  71. data/docs/usage/use_tag_namespace.md +0 -182
  72. data/docs/usage/view_docs.md +0 -262
  73. data/lib/r2-oas/deploy/swagger-ui/dist/favicon-16x16.png +0 -0
  74. data/lib/r2-oas/deploy/swagger-ui/dist/favicon-32x32.png +0 -0
  75. data/lib/r2-oas/deploy/swagger-ui/dist/oauth2-redirect.html +0 -68
  76. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-bundle.js +0 -134
  77. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-bundle.js.map +0 -1
  78. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-standalone-preset.js +0 -22
  79. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-standalone-preset.js.map +0 -1
  80. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.css +0 -4
  81. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.css.map +0 -1
  82. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.js +0 -9
  83. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.js.map +0 -1
@@ -1,35 +0,0 @@
1
-
2
- # Display paths list
3
-
4
- ## Prepare
5
-
6
- Add this line to your application's Gemfile:
7
-
8
- ```ruby
9
- group :development do
10
- gem 'r2-oas'
11
- end
12
- ```
13
-
14
- ## Comamnd
15
-
16
- ```
17
- $ bundle exec rake routes:oas:paths_ls
18
- ```
19
-
20
- ## Example
21
-
22
- ```bash
23
- $ bundle exec rake routes:oas:paths_ls
24
- /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
25
- /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/account_user_role.yml
26
- /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/user.yml
27
- /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/account.yml
28
- /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
29
- /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
30
- /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/custom_post.yml
31
- /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
32
- /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
33
- /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
34
- /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
35
- ```
@@ -1,54 +0,0 @@
1
-
2
- # Display paths stats
3
-
4
- ## Prepare
5
-
6
- Add this line to your application's Gemfile:
7
-
8
- ```ruby
9
- group :development do
10
- gem 'r2-oas'
11
- end
12
- ```
13
-
14
- ## Command
15
-
16
- ```bash
17
- $ bundle exec rake routes:oas:paths_stats
18
- ```
19
-
20
- ## Example
21
-
22
-
23
- ```bash
24
- $ bundle exec rake routes:oas:paths_stats
25
- +----+--------------------------------------------------------+---------------------------+---------------------------+
26
- | Paths Stats |
27
- +----+--------------------------------------------------------+---------------------------+---------------------------+
28
- | No | File Path | Created At | Updated At |
29
- +----+--------------------------------------------------------+---------------------------+---------------------------+
30
- | 1 | oas_docs/schema/paths/user.yml | 2019-06-29 00:39:27 +0900 | 2019-06-29 01:20:33 +0900 |
31
- +----+--------------------------------------------------------+---------------------------+---------------------------+
32
- | 2 | oas_docs/schema/paths/api/v1/account_user_role.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
33
- +----+--------------------------------------------------------+---------------------------+---------------------------+
34
- | 3 | oas_docs/schema/paths/api/v1/user.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
35
- +----+--------------------------------------------------------+---------------------------+---------------------------+
36
- | 4 | oas_docs/schema/paths/api/v1/account.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
37
- +----+--------------------------------------------------------+---------------------------+---------------------------+
38
- | 5 | oas_docs/schema/paths/api/v1/task.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
39
- +----+--------------------------------------------------------+---------------------------+---------------------------+
40
- | 6 | oas_docs/schema/paths/api/v1/post.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
41
- +----+--------------------------------------------------------+---------------------------+---------------------------+
42
- | 7 | oas_docs/schema/paths/api/v2/custom_post.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
43
- +----+--------------------------------------------------------+---------------------------+---------------------------+
44
- | 8 | oas_docs/schema/paths/api/v2/post.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
45
- +----+--------------------------------------------------------+---------------------------+---------------------------+
46
- | 9 | oas_docs/schema/paths/task.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
47
- +----+--------------------------------------------------------+---------------------------+---------------------------+
48
- | 10 | oas_docs/schema/paths/rails_admin/engine.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
49
- +----+--------------------------------------------------------+---------------------------+---------------------------+
50
- | 11 | oas_docs/schema/paths/rails_admin/main.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
51
- +----+--------------------------------------------------------+---------------------------+---------------------------+
52
-
53
- Red: over 3 months since the last update.
54
- ```
@@ -1,218 +0,0 @@
1
- # Edit docs
2
-
3
- ## Prepare
4
-
5
- Add this line to your application's Gemfile:
6
-
7
- ```ruby
8
- group :development do
9
- gem 'r2-oas'
10
- end
11
- ```
12
-
13
- ## Command
14
-
15
- ```bash
16
- $ bundle exec rake routes:oas:editor
17
- ```
18
-
19
- ## Example
20
-
21
- if there is routing like this:
22
-
23
- ```
24
- $ bundle exec rake routes
25
- Prefix Verb URI Pattern Controller#Action
26
- rails_admin /admin RailsAdmin::Engine
27
- api_v2_posts GET /api/v2/posts(.:format) api/v2/posts#index {:format=>:json}
28
- POST /api/v2/posts(.:format) api/v2/posts#create {:format=>:json}
29
- new_api_v2_post GET /api/v2/posts/new(.:format) api/v2/posts#new {:format=>:json}
30
- edit_api_v2_post GET /api/v2/posts/:id/edit(.:format) api/v2/posts#edit {:format=>:json}
31
- api_v2_post GET /api/v2/posts/:id(.:format) api/v2/posts#show {:format=>:json}
32
- PATCH /api/v2/posts/:id(.:format) api/v2/posts#update {:format=>:json}
33
- PUT /api/v2/posts/:id(.:format) api/v2/posts#update {:format=>:json}
34
- DELETE /api/v2/posts/:id(.:format) api/v2/posts#destroy {:format=>:json}
35
- api_v1_posts GET /api/v1/posts(.:format) api/v1/posts#index
36
- POST /api/v1/posts(.:format) api/v1/posts#create
37
- new_api_v1_post GET /api/v1/posts/new(.:format) api/v1/posts#new
38
- edit_api_v1_post GET /api/v1/posts/:id/edit(.:format) api/v1/posts#edit
39
- api_v1_post GET /api/v1/posts/:id(.:format) api/v1/posts#show
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
79
- ```
80
-
81
- #### First try
82
-
83
- The editor starts up with the schema set.
84
-
85
- <img alt="swagger_editor" src="https://user-images.githubusercontent.com/11146767/55682235-a8361480-596b-11e9-8c0c-718c8eed1393.png" width="546">
86
-
87
- ```
88
- I, [2019-04-07T19:24:44.832837 #33139] INFO -- : [R2-OAS] start
89
- I, [2019-04-07T19:24:44.832980 #33139] INFO -- : [R2-OAS] start
90
- I, [2019-04-07T19:24:44.941617 #33139] INFO -- : [Generate Swagger schema files] start
91
- I, [2019-04-07T19:24:44.941859 #33139] INFO -- : <From schema files>
92
- I, [2019-04-07T19:24:44.943345 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
93
- I, [2019-04-07T19:24:44.944161 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
94
- I, [2019-04-07T19:24:44.944934 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
95
- I, [2019-04-07T19:24:44.945433 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
96
- I, [2019-04-07T19:24:44.946134 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
97
- I, [2019-04-07T19:24:44.946595 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
98
- I, [2019-04-07T19:24:44.947051 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
99
- I, [2019-04-07T19:24:44.947883 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
100
- I, [2019-04-07T19:24:44.948154 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
101
- I, [2019-04-07T19:24:44.948699 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
102
- I, [2019-04-07T19:24:44.949193 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
103
- I, [2019-04-07T19:24:44.949423 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
104
- I, [2019-04-07T19:24:44.949694 #33139] INFO -- : <Update schema files>
105
- I, [2019-04-07T19:24:44.950397 #33139] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
106
- I, [2019-04-07T19:24:44.950846 #33139] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
107
- I, [2019-04-07T19:24:44.951710 #33139] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
108
- I, [2019-04-07T19:24:44.951779 #33139] INFO -- : [Generate Swagger schema files (paths)] start
109
- I, [2019-04-07T19:24:44.980847 #33139] INFO -- : <From schema files>
110
- I, [2019-04-07T19:24:44.981390 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
111
- I, [2019-04-07T19:24:44.981742 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
112
- I, [2019-04-07T19:24:44.982088 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
113
- I, [2019-04-07T19:24:44.982510 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
114
- I, [2019-04-07T19:24:44.982843 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
115
- I, [2019-04-07T19:24:44.983202 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
116
- I, [2019-04-07T19:24:44.984177 #33139] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
117
- I, [2019-04-07T19:24:44.984565 #33139] INFO -- : <Update schema files (paths)>
118
- I, [2019-04-07T19:24:44.985294 #33139] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
119
- I, [2019-04-07T19:24:44.986665 #33139] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
120
- I, [2019-04-07T19:24:44.987585 #33139] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
121
- I, [2019-04-07T19:24:44.988493 #33139] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
122
- I, [2019-04-07T19:24:44.989595 #33139] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
123
- I, [2019-04-07T19:24:44.990660 #33139] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
124
- I, [2019-04-07T19:24:44.992520 #33139] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
125
- I, [2019-04-07T19:24:44.992553 #33139] INFO -- : [Generate Swagger schema files (paths)] end
126
- I, [2019-04-07T19:24:44.992863 #33139] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
127
- I, [2019-04-07T19:24:44.993229 #33139] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
128
- I, [2019-04-07T19:24:44.993272 #33139] INFO -- : [Generate Swagger schema files] end
129
- I, [2019-04-07T19:24:44.993311 #33139] INFO -- : [Generate Swagger docs from schema files] start
130
- I, [2019-04-07T19:24:44.993774 #33139] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
131
- I, [2019-04-07T19:24:44.994197 #33139] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
132
- I, [2019-04-07T19:24:44.994627 #33139] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
133
- I, [2019-04-07T19:24:44.994967 #33139] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
134
- I, [2019-04-07T19:24:44.995438 #33139] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
135
- I, [2019-04-07T19:24:44.995860 #33139] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
136
- I, [2019-04-07T19:24:44.996097 #33139] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
137
- I, [2019-04-07T19:24:44.996770 #33139] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
138
- I, [2019-04-07T19:24:44.996885 #33139] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
139
- I, [2019-04-07T19:24:44.997187 #33139] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
140
- I, [2019-04-07T19:24:44.997401 #33139] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
141
- I, [2019-04-07T19:24:44.997522 #33139] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
142
- I, [2019-04-07T19:24:45.003195 #33139] INFO -- : [Generate Swagger docs from schema files] end
143
- I, [2019-04-07T19:24:45.003223 #33139] INFO -- : [R2-OAS] end
144
-
145
- wait for single trap ...
146
-
147
- ```
148
-
149
- When you press `Ctrl + C` after edit schema , the editor closes and the following message appears.
150
-
151
- ```
152
- ^C
153
- save updated schema in tempfile path: tmp/edited_schema20190407-33493-mxw638.yaml
154
- container id: 1a9752d2702045b2fde587dda3ce064233a735165f9b70bc6f86e603abfe3a39 removed
155
- I, [2019-04-07T19:43:53.666565 #33493] INFO -- : [R2-OAS] end
156
- ```
157
-
158
- ## Use PATHS_FILE environment
159
-
160
- If you want to generate docs by squeezing unit paths (For example, `api/v1/task.yml`),
161
- you set `PATHS_FILE` environment like this:
162
-
163
- ```bash
164
- $ PATHS_FILE="../oas_docs/schema/paths/api/v1/task.yml" bundle exec rake routes:oas:editor
165
- ```
166
-
167
- ```
168
- I, [2019-04-07T19:48:40.140872 #34907] INFO -- : [R2-OAS] start
169
- I, [2019-04-07T19:48:40.140990 #34907] INFO -- : [R2-OAS] start
170
- I, [2019-04-07T19:48:40.252636 #34907] INFO -- : [Generate Swagger schema files] start
171
- I, [2019-04-07T19:48:40.252835 #34907] INFO -- : <From schema files>
172
- I, [2019-04-07T19:48:40.253463 #34907] INFO -- : Fetch schema file: ../oas_docs/schema/paths/api/v1/task.yml
173
- I, [2019-04-07T19:48:40.253587 #34907] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
174
- I, [2019-04-07T19:48:40.253707 #34907] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
175
- I, [2019-04-07T19:48:40.254045 #34907] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
176
- I, [2019-04-07T19:48:40.254276 #34907] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
177
- I, [2019-04-07T19:48:40.254430 #34907] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
178
- I, [2019-04-07T19:48:40.254522 #34907] INFO -- : <Update schema files>
179
- I, [2019-04-07T19:48:40.255059 #34907] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
180
- I, [2019-04-07T19:48:40.255565 #34907] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
181
- I, [2019-04-07T19:48:40.256410 #34907] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
182
- I, [2019-04-07T19:48:40.256433 #34907] INFO -- : [Generate Swagger schema files (paths)] start
183
- I, [2019-04-07T19:48:40.287252 #34907] INFO -- : <From schema files>
184
- I, [2019-04-07T19:48:40.288195 #34907] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
185
- I, [2019-04-07T19:48:40.288253 #34907] INFO -- : <Update schema files (paths)>
186
- I, [2019-04-07T19:48:40.289027 #34907] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
187
- I, [2019-04-07T19:48:40.290245 #34907] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
188
- I, [2019-04-07T19:48:40.291226 #34907] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
189
- I, [2019-04-07T19:48:40.292277 #34907] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
190
- I, [2019-04-07T19:48:40.293109 #34907] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
191
- I, [2019-04-07T19:48:40.294190 #34907] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
192
- I, [2019-04-07T19:48:40.296321 #34907] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
193
- I, [2019-04-07T19:48:40.296357 #34907] INFO -- : [Generate Swagger schema files (paths)] end
194
- I, [2019-04-07T19:48:40.296651 #34907] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
195
- I, [2019-04-07T19:48:40.297043 #34907] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
196
- I, [2019-04-07T19:48:40.297068 #34907] INFO -- : [Generate Swagger schema files] end
197
- I, [2019-04-07T19:48:40.297093 #34907] INFO -- : [Generate Swagger docs from schema files] start
198
- I, [2019-04-07T19:48:40.297631 #34907] INFO -- : Use schema file: ../oas_docs/schema/paths/api/v1/task.yml
199
- I, [2019-04-07T19:48:40.297797 #34907] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
200
- I, [2019-04-07T19:48:40.297956 #34907] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
201
- I, [2019-04-07T19:48:40.298421 #34907] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
202
- I, [2019-04-07T19:48:40.298720 #34907] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
203
- I, [2019-04-07T19:48:40.298994 #34907] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
204
- I, [2019-04-07T19:48:40.302896 #34907] INFO -- : [Generate Swagger docs from schema files] end
205
- I, [2019-04-07T19:48:40.302938 #34907] INFO -- : [R2-OAS] end
206
-
207
- wait for single trap ...
208
-
209
- ```
210
-
211
- When you press `Ctrl + C` after edit schema , the editor closes and the following message appears.
212
-
213
- ```
214
- ^C
215
- save updated schema in tempfile path: tmp/edited_schema20190407-34907-1iv0ao0.yaml
216
- container id: 7b58246777eabb9206d852e587a491e0815444982779985dbd2e27c30cbfff59 removed
217
- I, [2019-04-07T19:50:26.402777 #34907] INFO -- : [R2-OAS] end
218
- ```
@@ -1,256 +0,0 @@
1
- # Generate docs
2
-
3
- ## Prepare
4
-
5
- Add this line to your application's Gemfile:
6
-
7
- ```ruby
8
- group :development do
9
- gem 'r2-oas'
10
- end
11
- ```
12
-
13
- ## Command
14
-
15
- ```bash
16
- $ bundle exec rake routes:oas:docs
17
- ```
18
-
19
- ## Example
20
-
21
- if there is routing like this:
22
-
23
- ```
24
- $ bundle exec rake routes
25
- Prefix Verb URI Pattern Controller#Action
26
- rails_admin /admin RailsAdmin::Engine
27
- api_v2_posts GET /api/v2/posts(.:format) api/v2/posts#index {:format=>:json}
28
- POST /api/v2/posts(.:format) api/v2/posts#create {:format=>:json}
29
- new_api_v2_post GET /api/v2/posts/new(.:format) api/v2/posts#new {:format=>:json}
30
- edit_api_v2_post GET /api/v2/posts/:id/edit(.:format) api/v2/posts#edit {:format=>:json}
31
- api_v2_post GET /api/v2/posts/:id(.:format) api/v2/posts#show {:format=>:json}
32
- PATCH /api/v2/posts/:id(.:format) api/v2/posts#update {:format=>:json}
33
- PUT /api/v2/posts/:id(.:format) api/v2/posts#update {:format=>:json}
34
- DELETE /api/v2/posts/:id(.:format) api/v2/posts#destroy {:format=>:json}
35
- api_v1_posts GET /api/v1/posts(.:format) api/v1/posts#index
36
- POST /api/v1/posts(.:format) api/v1/posts#create
37
- new_api_v1_post GET /api/v1/posts/new(.:format) api/v1/posts#new
38
- edit_api_v1_post GET /api/v1/posts/:id/edit(.:format) api/v1/posts#edit
39
- api_v1_post GET /api/v1/posts/:id(.:format) api/v1/posts#show
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
79
- ```
80
-
81
- #### First try
82
-
83
- ```
84
- $ bundle exec rake routes:oas:docs
85
- I, [2019-03-17T16:54:22.141619 #46769] INFO -- : [R2-OAS] start
86
- I, [2019-03-17T16:54:22.180295 #46769] INFO -- : [Generate Swagger schema files] start
87
- I, [2019-03-17T16:54:22.201397 #46769] INFO -- : <From routes data>
88
- I, [2019-03-17T16:54:22.202094 #46769] INFO -- : <Update schema files>
89
- I, [2019-03-17T16:54:22.222877 #46769] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
90
- I, [2019-03-17T16:54:22.223625 #46769] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
91
- I, [2019-03-17T16:54:22.226086 #46769] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
92
- I, [2019-03-17T16:54:22.226130 #46769] INFO -- : [Generate Swagger schema files (paths)] start
93
- I, [2019-03-17T16:54:22.260274 #46769] INFO -- : <From routes data>
94
- I, [2019-03-17T16:54:22.260478 #46769] INFO -- : <Update schema files (paths)>
95
- I, [2019-03-17T16:54:22.261223 #46769] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
96
- I, [2019-03-17T16:54:22.263575 #46769] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
97
- I, [2019-03-17T16:54:22.264573 #46769] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
98
- I, [2019-03-17T16:54:22.265477 #46769] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
99
- I, [2019-03-17T16:54:22.266426 #46769] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
100
- I, [2019-03-17T16:54:22.267318 #46769] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
101
- I, [2019-03-17T16:54:22.269068 #46769] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
102
- I, [2019-03-17T16:54:22.269091 #46769] INFO -- : [Generate Swagger schema files (paths)] end
103
- I, [2019-03-17T16:54:22.269351 #46769] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
104
- I, [2019-03-17T16:54:22.269645 #46769] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
105
- I, [2019-03-17T16:54:22.269667 #46769] INFO -- : [Generate Swagger schema files] end
106
- I, [2019-03-17T16:54:22.269678 #46769] INFO -- : [Generate Swagger docs from schema files] start
107
- I, [2019-03-17T16:54:22.270080 #46769] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
108
- I, [2019-03-17T16:54:22.270477 #46769] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
109
- I, [2019-03-17T16:54:22.270870 #46769] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
110
- I, [2019-03-17T16:54:22.271238 #46769] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
111
- I, [2019-03-17T16:54:22.271700 #46769] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
112
- I, [2019-03-17T16:54:22.272125 #46769] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
113
- I, [2019-03-17T16:54:22.272329 #46769] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
114
- I, [2019-03-17T16:54:22.272953 #46769] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
115
- I, [2019-03-17T16:54:22.273071 #46769] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
116
- I, [2019-03-17T16:54:22.273414 #46769] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
117
- I, [2019-03-17T16:54:22.273598 #46769] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
118
- I, [2019-03-17T16:54:22.273724 #46769] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
119
- I, [2019-03-17T16:54:22.279880 #46769] INFO -- : [Generate Swagger docs from schema files] end
120
- I, [2019-03-17T16:54:22.279916 #46769] INFO -- : [R2-OAS] end
121
- ```
122
-
123
- #### Second try
124
-
125
- ```
126
- $ bundle exec rake routes:oas:docs
127
- I, [2019-03-17T16:54:49.460842 #46856] INFO -- : [R2-OAS] start
128
- I, [2019-03-17T16:54:49.500295 #46856] INFO -- : [Generate Swagger schema files] start
129
- I, [2019-03-17T16:54:49.523519 #46856] INFO -- : <From schema files>
130
- I, [2019-03-17T16:54:49.524119 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
131
- I, [2019-03-17T16:54:49.524509 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
132
- I, [2019-03-17T16:54:49.525053 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
133
- I, [2019-03-17T16:54:49.525392 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
134
- I, [2019-03-17T16:54:49.526041 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
135
- I, [2019-03-17T16:54:49.527038 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
136
- I, [2019-03-17T16:54:49.527304 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
137
- I, [2019-03-17T16:54:49.528432 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
138
- I, [2019-03-17T16:54:49.528612 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
139
- I, [2019-03-17T16:54:49.529722 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
140
- I, [2019-03-17T16:54:49.530027 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
141
- I, [2019-03-17T16:54:49.530347 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
142
- I, [2019-03-17T16:54:49.549819 #46856] INFO -- : <Update schema files>
143
- I, [2019-03-17T16:54:49.569043 #46856] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
144
- I, [2019-03-17T16:54:49.569765 #46856] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
145
- I, [2019-03-17T16:54:49.571002 #46856] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
146
- I, [2019-03-17T16:54:49.571044 #46856] INFO -- : [Generate Swagger schema files (paths)] start
147
- I, [2019-03-17T16:54:49.589225 #46856] INFO -- : <From schema files>
148
- I, [2019-03-17T16:54:49.589799 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
149
- I, [2019-03-17T16:54:49.590198 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
150
- I, [2019-03-17T16:54:49.590557 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
151
- I, [2019-03-17T16:54:49.591016 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
152
- I, [2019-03-17T16:54:49.591391 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
153
- I, [2019-03-17T16:54:49.591592 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
154
- I, [2019-03-17T16:54:49.592263 #46856] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
155
- I, [2019-03-17T16:54:49.592539 #46856] INFO -- : <Update schema files (paths)>
156
- I, [2019-03-17T16:54:49.593116 #46856] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
157
- I, [2019-03-17T16:54:49.594214 #46856] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
158
- I, [2019-03-17T16:54:49.595061 #46856] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
159
- I, [2019-03-17T16:54:49.595931 #46856] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
160
- I, [2019-03-17T16:54:49.596811 #46856] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
161
- I, [2019-03-17T16:54:49.597706 #46856] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
162
- I, [2019-03-17T16:54:49.599774 #46856] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
163
- I, [2019-03-17T16:54:49.599809 #46856] INFO -- : [Generate Swagger schema files (paths)] end
164
- I, [2019-03-17T16:54:49.600113 #46856] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
165
- I, [2019-03-17T16:54:49.600459 #46856] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
166
- I, [2019-03-17T16:54:49.600482 #46856] INFO -- : [Generate Swagger schema files] end
167
- I, [2019-03-17T16:54:49.600496 #46856] INFO -- : [Generate Swagger docs from schema files] start
168
- I, [2019-03-17T16:54:49.600893 #46856] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
169
- I, [2019-03-17T16:54:49.601240 #46856] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
170
- I, [2019-03-17T16:54:49.601649 #46856] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
171
- I, [2019-03-17T16:54:49.602124 #46856] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
172
- I, [2019-03-17T16:54:49.602698 #46856] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
173
- I, [2019-03-17T16:54:49.603179 #46856] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
174
- I, [2019-03-17T16:54:49.603416 #46856] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
175
- I, [2019-03-17T16:54:49.604173 #46856] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
176
- I, [2019-03-17T16:54:49.604317 #46856] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
177
- I, [2019-03-17T16:54:49.604653 #46856] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
178
- I, [2019-03-17T16:54:49.604875 #46856] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
179
- I, [2019-03-17T16:54:49.604996 #46856] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/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
182
- ```
183
-
184
- Generate like this:
185
-
186
- ```
187
- oas_docs
188
- ├── schema
189
- │   ├── externalDocs.yml
190
- │   ├── info.yml
191
- │   ├── openapi.yml
192
- │   ├── paths
193
- │   │   ├── api
194
- │   │   │   ├── v1
195
- │   │   │   │   ├── post.yml
196
- │   │   │   │   └── task.yml
197
- │   │   │   └── v2
198
- │   │   │   └── post.yml
199
- │   │   ├── rails_admin
200
- │   │   │   ├── engine.yml
201
- │   │   │   └── main.yml
202
- │   │   ├── task.yml
203
- │   │   └── user.yml
204
- │   ├── servers.yml
205
- │   └── tags.yml
206
- └── oas_doc.yml
207
- ```
208
-
209
- ## Advanced Usage
210
-
211
- If you want to generate docs by squeezing unit paths (For example, `api/v1/task.yml`),
212
- you set `PATHS_FILE` environment like this:
213
-
214
- ```bash
215
- $ PATHS_FILE="../oas_docs/schema/paths/api/v1/task.yml" bundle exec rake routes:oas:docs
216
- ```
217
-
218
- ```
219
- I, [2019-04-07T19:18:37.478650 #32978] INFO -- : [R2-OAS] start
220
- I, [2019-04-07T19:18:37.585622 #32978] INFO -- : [Generate Swagger schema files] start
221
- I, [2019-04-07T19:18:37.585786 #32978] INFO -- : <From schema files>
222
- I, [2019-04-07T19:18:37.587302 #32978] INFO -- : Fetch schema file: ../oas_docs/schema/paths/api/v1/task.yml
223
- I, [2019-04-07T19:18:37.587865 #32978] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
224
- I, [2019-04-07T19:18:37.588549 #32978] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
225
- I, [2019-04-07T19:18:37.589428 #32978] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
226
- I, [2019-04-07T19:18:37.589899 #32978] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
227
- I, [2019-04-07T19:18:37.590411 #32978] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
228
- I, [2019-04-07T19:18:37.590505 #32978] INFO -- : <Update schema files>
229
- I, [2019-04-07T19:18:37.591127 #32978] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
230
- I, [2019-04-07T19:18:37.591617 #32978] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
231
- I, [2019-04-07T19:18:37.592455 #32978] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
232
- I, [2019-04-07T19:18:37.592477 #32978] INFO -- : [Generate Swagger schema files (paths)] start
233
- I, [2019-04-07T19:18:37.622570 #32978] INFO -- : <From schema files>
234
- I, [2019-04-07T19:18:37.623078 #32978] INFO -- : Fetch schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
235
- I, [2019-04-07T19:18:37.623139 #32978] INFO -- : <Update schema files (paths)>
236
- I, [2019-04-07T19:18:37.623898 #32978] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
237
- I, [2019-04-07T19:18:37.625018 #32978] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
238
- I, [2019-04-07T19:18:37.625798 #32978] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
239
- I, [2019-04-07T19:18:37.626779 #32978] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
240
- I, [2019-04-07T19:18:37.627636 #32978] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
241
- I, [2019-04-07T19:18:37.628434 #32978] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
242
- I, [2019-04-07T19:18:37.629968 #32978] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
243
- I, [2019-04-07T19:18:37.629988 #32978] INFO -- : [Generate Swagger schema files (paths)] end
244
- I, [2019-04-07T19:18:37.630307 #32978] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
245
- I, [2019-04-07T19:18:37.630702 #32978] INFO -- : Merge schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
246
- I, [2019-04-07T19:18:37.630755 #32978] INFO -- : [Generate Swagger schema files] end
247
- I, [2019-04-07T19:18:37.630767 #32978] INFO -- : [Generate Swagger docs from schema files] start
248
- I, [2019-04-07T19:18:37.631307 #32978] INFO -- : Use schema file: ../oas_docs/schema/paths/api/v1/task.yml
249
- I, [2019-04-07T19:18:37.631430 #32978] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
250
- I, [2019-04-07T19:18:37.631542 #32978] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
251
- I, [2019-04-07T19:18:37.631828 #32978] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
252
- I, [2019-04-07T19:18:37.632022 #32978] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
253
- I, [2019-04-07T19:18:37.632137 #32978] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
254
- I, [2019-04-07T19:18:37.634667 #32978] INFO -- : [Generate Swagger docs from schema files] end
255
- I, [2019-04-07T19:18:37.634690 #32978] INFO -- : [R2-OAS] end
256
- ```