r2-oas 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +7 -0
  2. data/.github/ISSUE_TEMPLATE.md +12 -0
  3. data/.github/PULL_REQUEST_TEMPLATE.md +12 -0
  4. data/.gitignore +12 -0
  5. data/.rspec +3 -0
  6. data/.rubocop.yml +7 -0
  7. data/.rubocop_todo.yml +224 -0
  8. data/.travis.yml +22 -0
  9. data/CHANGELOG.md +3 -0
  10. data/CODE_OF_CONDUCT.md +74 -0
  11. data/Gemfile +12 -0
  12. data/Gemfile.lock +207 -0
  13. data/LICENSE.txt +21 -0
  14. data/README.ja.md +585 -0
  15. data/README.md +582 -0
  16. data/Rakefile +8 -0
  17. data/bin/console +12 -0
  18. data/bin/setup +8 -0
  19. data/docs/HOW_TO_ANALYZE_DOCS.md +875 -0
  20. data/docs/HOW_TO_CLEAN_DOCS.md +19 -0
  21. data/docs/HOW_TO_DEPLOY_SWAGGER_DOC.md +839 -0
  22. data/docs/HOW_TO_DISPLAY_PATHS_LIST.md +28 -0
  23. data/docs/HOW_TO_DISPLAY_PATHS_STATS.md +53 -0
  24. data/docs/HOW_TO_GENERATE_DOCS.md +256 -0
  25. data/docs/HOW_TO_MONITOR_SWAGGER_DOC.md +219 -0
  26. data/docs/HOW_TO_START_SWAGGER_EDITOR.md +218 -0
  27. data/docs/HOW_TO_START_SWAGGER_UI.md +262 -0
  28. data/docs/HOW_TO_USE_HOOK_WHEN_GENERATE_DOC.md +244 -0
  29. data/docs/HOW_TO_USE_SCHEMA_NAMESPACE.md +176 -0
  30. data/docs/HOW_TO_USE_TAG_NAMESPACE.md +176 -0
  31. data/docs/versions/v3.md +155 -0
  32. data/lib/r2-oas.rb +36 -0
  33. data/lib/r2-oas/app_configuration.rb +102 -0
  34. data/lib/r2-oas/app_configuration/server.rb +35 -0
  35. data/lib/r2-oas/app_configuration/swagger.rb +35 -0
  36. data/lib/r2-oas/app_configuration/swagger/editor.rb +47 -0
  37. data/lib/r2-oas/app_configuration/swagger/ui.rb +45 -0
  38. data/lib/r2-oas/app_configuration/tool.rb +31 -0
  39. data/lib/r2-oas/app_configuration/tool/paths/stats.rb +43 -0
  40. data/lib/r2-oas/base.rb +48 -0
  41. data/lib/r2-oas/configuration.rb +69 -0
  42. data/lib/r2-oas/configuration/paths_config.rb +44 -0
  43. data/lib/r2-oas/deploy/client.rb +43 -0
  44. data/lib/r2-oas/deploy/swagger-ui/dist/favicon-16x16.png +0 -0
  45. data/lib/r2-oas/deploy/swagger-ui/dist/favicon-32x32.png +0 -0
  46. data/lib/r2-oas/deploy/swagger-ui/dist/oauth2-redirect.html +68 -0
  47. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-bundle.js +134 -0
  48. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-bundle.js.map +1 -0
  49. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-standalone-preset.js +22 -0
  50. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui-standalone-preset.js.map +1 -0
  51. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.css +4 -0
  52. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.css.map +1 -0
  53. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.js +9 -0
  54. data/lib/r2-oas/deploy/swagger-ui/dist/swagger-ui.js.map +1 -0
  55. data/lib/r2-oas/deploy/swagger-ui/index.html.erb +60 -0
  56. data/lib/r2-oas/errors.rb +7 -0
  57. data/lib/r2-oas/hooks/global_hook.rb +20 -0
  58. data/lib/r2-oas/hooks/hook.rb +77 -0
  59. data/lib/r2-oas/hooks/repository.rb +15 -0
  60. data/lib/r2-oas/logger/stdout_logger.rb +129 -0
  61. data/lib/r2-oas/pluggable_configuration.rb +33 -0
  62. data/lib/r2-oas/plugins/schema/v3/object/hookable_base_object.rb +100 -0
  63. data/lib/r2-oas/routing/adjustor.rb +44 -0
  64. data/lib/r2-oas/routing/base.rb +12 -0
  65. data/lib/r2-oas/routing/components/all.rb +5 -0
  66. data/lib/r2-oas/routing/components/base_component.rb +10 -0
  67. data/lib/r2-oas/routing/components/path_component.rb +67 -0
  68. data/lib/r2-oas/routing/components/request_component.rb +75 -0
  69. data/lib/r2-oas/routing/components/verb_component.rb +21 -0
  70. data/lib/r2-oas/routing/parser.rb +93 -0
  71. data/lib/r2-oas/schema/analyzer.rb +23 -0
  72. data/lib/r2-oas/schema/base.rb +11 -0
  73. data/lib/r2-oas/schema/cleaner.rb +23 -0
  74. data/lib/r2-oas/schema/editor.rb +120 -0
  75. data/lib/r2-oas/schema/generator.rb +23 -0
  76. data/lib/r2-oas/schema/manager/file/path_item_file_manager.rb +24 -0
  77. data/lib/r2-oas/schema/monitor.rb +52 -0
  78. data/lib/r2-oas/schema/squeezer.rb +23 -0
  79. data/lib/r2-oas/schema/ui.rb +74 -0
  80. data/lib/r2-oas/schema/v3/analyzer.rb +58 -0
  81. data/lib/r2-oas/schema/v3/analyzer/base_analyzer.rb +76 -0
  82. data/lib/r2-oas/schema/v3/analyzer/components/object_analyzer.rb +38 -0
  83. data/lib/r2-oas/schema/v3/analyzer/components_analyzer.rb +30 -0
  84. data/lib/r2-oas/schema/v3/analyzer/path_analyzer.rb +116 -0
  85. data/lib/r2-oas/schema/v3/analyzer/tag_analyzer.rb +38 -0
  86. data/lib/r2-oas/schema/v3/base.rb +28 -0
  87. data/lib/r2-oas/schema/v3/cleaner.rb +19 -0
  88. data/lib/r2-oas/schema/v3/cleaner/base_cleaner.rb +30 -0
  89. data/lib/r2-oas/schema/v3/cleaner/components_cleaner.rb +42 -0
  90. data/lib/r2-oas/schema/v3/generator.rb +28 -0
  91. data/lib/r2-oas/schema/v3/generator/base_generator.rb +88 -0
  92. data/lib/r2-oas/schema/v3/generator/components/object_generator.rb +83 -0
  93. data/lib/r2-oas/schema/v3/generator/components/request_body_generator.rb +45 -0
  94. data/lib/r2-oas/schema/v3/generator/components_generator.rb +38 -0
  95. data/lib/r2-oas/schema/v3/generator/doc_generator.rb +49 -0
  96. data/lib/r2-oas/schema/v3/generator/path_generator.rb +90 -0
  97. data/lib/r2-oas/schema/v3/generator/schema_generator.rb +78 -0
  98. data/lib/r2-oas/schema/v3/manager/diff/base_array_diff_manager.rb +60 -0
  99. data/lib/r2-oas/schema/v3/manager/diff/base_diff_manager.rb +29 -0
  100. data/lib/r2-oas/schema/v3/manager/diff/base_hash_diff_manager.rb +95 -0
  101. data/lib/r2-oas/schema/v3/manager/diff/components_diff_manager.rb +19 -0
  102. data/lib/r2-oas/schema/v3/manager/diff/tag_diff_manager.rb +17 -0
  103. data/lib/r2-oas/schema/v3/manager/file/base_file_manager.rb +60 -0
  104. data/lib/r2-oas/schema/v3/manager/file/components_file_manager.rb +22 -0
  105. data/lib/r2-oas/schema/v3/manager/file/include_ref_base_file_manager.rb +88 -0
  106. data/lib/r2-oas/schema/v3/manager/file/path_item_file_manager.rb +22 -0
  107. data/lib/r2-oas/schema/v3/manager/file_manager.rb +12 -0
  108. data/lib/r2-oas/schema/v3/manager/pathname_manager.rb +73 -0
  109. data/lib/r2-oas/schema/v3/object/base_object.rb +65 -0
  110. data/lib/r2-oas/schema/v3/object/components/request_body_object.rb +92 -0
  111. data/lib/r2-oas/schema/v3/object/components/schema_object.rb +55 -0
  112. data/lib/r2-oas/schema/v3/object/components_object.rb +81 -0
  113. data/lib/r2-oas/schema/v3/object/external_document_object.rb +19 -0
  114. data/lib/r2-oas/schema/v3/object/info_object.rb +34 -0
  115. data/lib/r2-oas/schema/v3/object/openapi_object.rb +58 -0
  116. data/lib/r2-oas/schema/v3/object/path_item_object.rb +167 -0
  117. data/lib/r2-oas/schema/v3/object/paths_object.rb +74 -0
  118. data/lib/r2-oas/schema/v3/object/public.rb +9 -0
  119. data/lib/r2-oas/schema/v3/object/server_object.rb +21 -0
  120. data/lib/r2-oas/schema/v3/object/tag_object.rb +36 -0
  121. data/lib/r2-oas/schema/v3/squeezer.rb +29 -0
  122. data/lib/r2-oas/schema/v3/squeezer/base_squeezer.rb +37 -0
  123. data/lib/r2-oas/schema/v3/squeezer/path_squeezer.rb +28 -0
  124. data/lib/r2-oas/schema/v3/squeezer/tag_squeezer.rb +19 -0
  125. data/lib/r2-oas/shared/all.rb +3 -0
  126. data/lib/r2-oas/shared/sortable.rb +23 -0
  127. data/lib/r2-oas/task.rb +11 -0
  128. data/lib/r2-oas/task_logging.rb +39 -0
  129. data/lib/r2-oas/tasks/common.rake +26 -0
  130. data/lib/r2-oas/tasks/main.rake +117 -0
  131. data/lib/r2-oas/tasks/tool.rake +79 -0
  132. data/lib/r2-oas/tool/paths/ls.rb +15 -0
  133. data/lib/r2-oas/tool/paths/stats.rb +84 -0
  134. data/lib/r2-oas/version.rb +5 -0
  135. data/r2-oas.gemspec +56 -0
  136. metadata +373 -0
@@ -0,0 +1,28 @@
1
+ ## Basic Usage
2
+
3
+ ```ruby
4
+
5
+ require 'r2-oas'
6
+
7
+ R2OAS.configure do |config|
8
+ # default setting
9
+ config.root_dir_path = "./oas_docs"
10
+ config.schema_save_dir_name = "src"
11
+ config.doc_save_file_name = "oas_doc.yml"
12
+ end
13
+ ```
14
+
15
+ ```bash
16
+ $ bundle exec rake routes:oas:paths_ls
17
+ /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
18
+ /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/account_user_role.yml
19
+ /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/user.yml
20
+ /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/account.yml
21
+ /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
22
+ /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
23
+ /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/custom_post.yml
24
+ /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
25
+ /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
26
+ /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
27
+ /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
28
+ ```
@@ -0,0 +1,53 @@
1
+ ## Basic Usage
2
+
3
+ ```ruby
4
+
5
+ require 'r2-oas'
6
+
7
+ R2OAS.configure do |config|
8
+ # default setting
9
+ config.root_dir_path = "./oas_docs"
10
+ config.schema_save_dir_name = "src"
11
+ config.doc_save_file_name = "oas_doc.yml"
12
+
13
+ config.tool.paths_stats.configure do |paths_stats|
14
+ paths_stats.month_to_turn_to_warning_color = 3
15
+ paths_stats.warning_color = :red
16
+ paths_stats.table_title_color = :yellow
17
+ paths_stats.heading_color = :yellow
18
+ end
19
+ end
20
+ ```
21
+
22
+ ```bash
23
+ $ bundle exec rake routes:oas:paths_stats
24
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
25
+ | Paths Stats |
26
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
27
+ | No | File Path | Created At | Updated At |
28
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
29
+ | 1 | oas_docs/schema/paths/user.yml | 2019-06-29 00:39:27 +0900 | 2019-06-29 01:20:33 +0900 |
30
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
31
+ | 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 |
32
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
33
+ | 3 | oas_docs/schema/paths/api/v1/user.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
34
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
35
+ | 4 | oas_docs/schema/paths/api/v1/account.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
36
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
37
+ | 5 | oas_docs/schema/paths/api/v1/task.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
38
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
39
+ | 6 | oas_docs/schema/paths/api/v1/post.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
40
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
41
+ | 7 | oas_docs/schema/paths/api/v2/custom_post.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
42
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
43
+ | 8 | oas_docs/schema/paths/api/v2/post.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
44
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
45
+ | 9 | oas_docs/schema/paths/task.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
46
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
47
+ | 10 | oas_docs/schema/paths/rails_admin/engine.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
48
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
49
+ | 11 | oas_docs/schema/paths/rails_admin/main.yml | 2019-06-29 00:28:56 +0900 | 2019-06-29 01:20:33 +0900 |
50
+ +----+--------------------------------------------------------+---------------------------+---------------------------+
51
+
52
+ Red: over 3 months since the last update.
53
+ ```
@@ -0,0 +1,256 @@
1
+ ## Basic Usage
2
+
3
+ ```ruby
4
+
5
+ require 'r2-oas'
6
+
7
+ R2OAS.configure do |config|
8
+ # default setting
9
+ config.root_dir_path = "./oas_docs"
10
+ config.schema_save_dir_name = "src"
11
+ config.doc_save_file_name = "oas_doc.yml"
12
+ end
13
+ ```
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
+ ```
@@ -0,0 +1,219 @@
1
+ ## Basic Usage
2
+
3
+ ```ruby
4
+
5
+ require 'r2-oas'
6
+
7
+ R2OAS.configure do |config|
8
+ # default setting
9
+ config.root_dir_path = "./oas_docs"
10
+ config.schema_save_dir_name = "src"
11
+ config.doc_save_file_name = "oas_doc.yml"
12
+ end
13
+ ```
14
+
15
+ ```bash
16
+ $ bundle exec rake routes:oas:monitor
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
+ api_v1_account_user_roles GET /api/v1/account_user_roles(.:format) api/v1/account_user_roles#index
27
+ new_api_v1_account_user_role GET /api/v1/account_user_roles/new(.:format) api/v1/account_user_roles#new
28
+ edit_api_v1_account_user_role GET /api/v1/account_user_roles/:id/edit(.:format) api/v1/account_user_roles#edit
29
+ api_v1_account_user_role GET /api/v1/account_user_roles/:id(.:format) api/v1/account_user_roles#show
30
+ PATCH /api/v1/account_user_roles/:id(.:format) api/v1/account_user_roles#update
31
+ PUT /api/v1/account_user_roles/:id(.:format) api/v1/account_user_roles#update
32
+ DELETE /api/v1/account_user_roles/:id(.:format) api/v1/account_user_roles#destroy
33
+ api_v1 POST /api/v1/accounts/:account_id/users(.:format) api/v1/account_user_role#create
34
+ api_v1_account_users GET /api/v1/accounts/:account_id/users(.:format) api/v1/users#index
35
+ new_api_v1_account_user GET /api/v1/accounts/:account_id/users/new(.:format) api/v1/users#new
36
+ edit_api_v1_account_user GET /api/v1/accounts/:account_id/users/:id/edit(.:format) api/v1/users#edit
37
+ api_v1_account_user GET /api/v1/accounts/:account_id/users/:id(.:format) api/v1/users#show
38
+ PATCH /api/v1/accounts/:account_id/users/:id(.:format) api/v1/users#update
39
+ PUT /api/v1/accounts/:account_id/users/:id(.:format) api/v1/users#update
40
+ DELETE /api/v1/accounts/:account_id/users/:id(.:format) api/v1/users#destroy
41
+ api_v1_accounts GET /api/v1/accounts(.:format) api/v1/accounts#index
42
+ POST /api/v1/accounts(.:format) api/v1/accounts#create
43
+ new_api_v1_account GET /api/v1/accounts/new(.:format) api/v1/accounts#new
44
+ edit_api_v1_account GET /api/v1/accounts/:id/edit(.:format) api/v1/accounts#edit
45
+ api_v1_account GET /api/v1/accounts/:id(.:format) api/v1/accounts#show
46
+ PATCH /api/v1/accounts/:id(.:format) api/v1/accounts#update
47
+ PUT /api/v1/accounts/:id(.:format) api/v1/accounts#update
48
+ DELETE /api/v1/accounts/:id(.:format) api/v1/accounts#destroy
49
+ GET /api/v1/account_user_roles(.:format) api/v1/account_user_roles#index
50
+ POST /api/v1/account_user_roles(.:format) api/v1/account_user_roles#create
51
+ GET /api/v1/account_user_roles/new(.:format) api/v1/account_user_roles#new
52
+ GET /api/v1/account_user_roles/:id/edit(.:format) api/v1/account_user_roles#edit
53
+ GET /api/v1/account_user_roles/:id(.:format) api/v1/account_user_roles#show
54
+ PATCH /api/v1/account_user_roles/:id(.:format) api/v1/account_user_roles#update
55
+ PUT /api/v1/account_user_roles/:id(.:format) api/v1/account_user_roles#update
56
+ DELETE /api/v1/account_user_roles/:id(.:format) api/v1/account_user_roles#destroy
57
+ api_v1_users GET /api/v1/users(.:format) api/v1/users#index
58
+ POST /api/v1/users(.:format) api/v1/users#create
59
+ new_api_v1_user GET /api/v1/users/new(.:format) api/v1/users#new
60
+ edit_api_v1_user GET /api/v1/users/:id/edit(.:format) api/v1/users#edit
61
+ api_v1_user GET /api/v1/users/:id(.:format) api/v1/users#show
62
+ PATCH /api/v1/users/:id(.:format) api/v1/users#update
63
+ PUT /api/v1/users/:id(.:format) api/v1/users#update
64
+ DELETE /api/v1/users/:id(.:format) api/v1/users#destroy
65
+ GET /api/v1/accounts(.:format) api/v1/accounts#index
66
+ POST /api/v1/accounts(.:format) api/v1/accounts#create
67
+ GET /api/v1/accounts/new(.:format) api/v1/accounts#new
68
+ GET /api/v1/accounts/:id/edit(.:format) api/v1/accounts#edit
69
+ GET /api/v1/accounts/:id(.:format) api/v1/accounts#show
70
+ PATCH /api/v1/accounts/:id(.:format) api/v1/accounts#update
71
+ PUT /api/v1/accounts/:id(.:format) api/v1/accounts#update
72
+ DELETE /api/v1/accounts/:id(.:format) api/v1/accounts#destroy
73
+ api_v2_custom_posts GET /api/v2/custom_posts(.:format) api/v2/custom_posts#index
74
+ POST /api/v2/custom_posts(.:format) api/v2/custom_posts#create
75
+ new_api_v2_custom_post GET /api/v2/custom_posts/new(.:format) api/v2/custom_posts#new
76
+ edit_api_v2_custom_post GET /api/v2/custom_posts/:id/edit(.:format) api/v2/custom_posts#edit
77
+ api_v2_custom_post GET /api/v2/custom_posts/:id(.:format) api/v2/custom_posts#show
78
+ PATCH /api/v2/custom_posts/:id(.:format) api/v2/custom_posts#update
79
+ PUT /api/v2/custom_posts/:id(.:format) api/v2/custom_posts#update
80
+ DELETE /api/v2/custom_posts/:id(.:format) api/v2/custom_posts#destroy
81
+ rails_subadmin /subadmin RailsAdmin::Engine
82
+ rails_admin /admin RailsAdmin::Engine
83
+ api_v2_posts GET /api/v2/posts(.:format) api/v2/posts#index {:format=>:json}
84
+ edit_api_v2_post GET /api/v2/posts/:id/edit(.:format) api/v2/posts#edit {:format=>:json}
85
+ api_v2_post GET /api/v2/posts/:id(.:format) api/v2/posts#show {:format=>:json}
86
+ PATCH /api/v2/posts/:id(.:format) api/v2/posts#update {:format=>:json}
87
+ PUT /api/v2/posts/:id(.:format) api/v2/posts#update {:format=>:json}
88
+ GET /api/v2/custom_posts(.:format) api/v2/custom_posts#index {:format=>:json}
89
+ GET /api/v2/custom_posts/:id/edit(.:format) api/v2/custom_posts#edit {:format=>:json}
90
+ GET /api/v2/custom_posts/:id(.:format) api/v2/custom_posts#show {:format=>:json}
91
+ PATCH /api/v2/custom_posts/:id(.:format) api/v2/custom_posts#update {:format=>:json}
92
+ PUT /api/v2/custom_posts/:id(.:format) api/v2/custom_posts#update {:format=>:json}
93
+ POST /api/v2/posts(.:format) api/v2/custom_posts#create {:format=>:json}
94
+ api_v1_posts GET /api/v1/posts(.:format) api/v1/posts#index
95
+ POST /api/v1/posts(.:format) api/v1/posts#create
96
+ new_api_v1_post GET /api/v1/posts/new(.:format) api/v1/posts#new
97
+ edit_api_v1_post GET /api/v1/posts/:id/edit(.:format) api/v1/posts#edit
98
+ api_v1_post GET /api/v1/posts/:id(.:format) api/v1/posts#show
99
+ PATCH /api/v1/posts/:id(.:format) api/v1/posts#update
100
+ PUT /api/v1/posts/:id(.:format) api/v1/posts#update
101
+ DELETE /api/v1/posts/:id(.:format) api/v1/posts#destroy
102
+ api_v1_tasks GET /api/v1/tasks(.:format) api/v1/tasks#index
103
+ POST /api/v1/tasks(.:format) api/v1/tasks#create
104
+ new_api_v1_task GET /api/v1/tasks/new(.:format) api/v1/tasks#new
105
+ edit_api_v1_task GET /api/v1/tasks/:id/edit(.:format) api/v1/tasks#edit
106
+ api_v1_task GET /api/v1/tasks/:id(.:format) api/v1/tasks#show
107
+ PATCH /api/v1/tasks/:id(.:format) api/v1/tasks#update
108
+ PUT /api/v1/tasks/:id(.:format) api/v1/tasks#update
109
+ DELETE /api/v1/tasks/:id(.:format) api/v1/tasks#destroy
110
+ tasks GET /tasks(.:format) tasks#index
111
+ POST /tasks(.:format) tasks#create
112
+ new_task GET /tasks/new(.:format) tasks#new
113
+ edit_task GET /tasks/:id/edit(.:format) tasks#edit
114
+ task GET /tasks/:id(.:format) tasks#show
115
+ PATCH /tasks/:id(.:format) tasks#update
116
+ PUT /tasks/:id(.:format) tasks#update
117
+ DELETE /tasks/:id(.:format) tasks#destroy
118
+ users GET /users(.:format) users#index
119
+ POST /users(.:format) users#create
120
+ new_user GET /users/new(.:format) users#new
121
+ edit_user GET /users/:id/edit(.:format) users#edit
122
+ user GET /users/:id(.:format) users#show
123
+ PATCH /users/:id(.:format) users#update
124
+ PUT /users/:id(.:format) users#update
125
+ DELETE /users/:id(.:format) users#destroy
126
+
127
+ Routes for RailsAdmin::Engine:
128
+ dashboard GET / rails_admin/main#dashboard
129
+ index GET|POST /:model_name(.:format) rails_admin/main#index
130
+ new GET|POST /:model_name/new(.:format) rails_admin/main#new
131
+ export GET|POST /:model_name/export(.:format) rails_admin/main#export
132
+ bulk_delete POST|DELETE /:model_name/bulk_delete(.:format) rails_admin/main#bulk_delete
133
+ bulk_action POST /:model_name/bulk_action(.:format) rails_admin/main#bulk_action
134
+ show GET /:model_name/:id(.:format) rails_admin/main#show
135
+ edit GET|PUT /:model_name/:id/edit(.:format) rails_admin/main#edit
136
+ delete GET|DELETE /:model_name/:id/delete(.:format) rails_admin/main#delete
137
+ show_in_app GET /:model_name/:id/show_in_app(.:format) rails_admin/main#show_in_app
138
+ ```
139
+
140
+ #### Usage
141
+
142
+ If you use [Swagger Viewer](https://marketplace.visualstudio.com/items?itemName=Arjun.swagger-viewer)
143
+
144
+ <img alt="swagger_editor" src="https://user-images.githubusercontent.com/11146767/60355006-75e70100-9a08-11e9-9f52-dfacb681791e.png" width="546">
145
+
146
+ ```
147
+ I, [2019-06-29T00:52:29.568306 #16277] INFO -- : [R2-OAS] start
148
+ I, [2019-06-29T00:52:29.857556 #16277] INFO -- : [Generate Swagger schema files] start
149
+ I, [2019-06-29T00:52:29.857599 #16277] INFO -- : [Generate Swagger schema files] end
150
+ I, [2019-06-29T00:52:29.857609 #16277] INFO -- : [Generate Swagger docs from schema files] start
151
+ I, [2019-06-29T00:52:29.858201 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/openapi.yml
152
+ I, [2019-06-29T00:52:29.859837 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
153
+ I, [2019-06-29T00:52:29.861592 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/account_user_role.yml
154
+ I, [2019-06-29T00:52:29.865069 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/user.yml
155
+ I, [2019-06-29T00:52:29.866911 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/account.yml
156
+ I, [2019-06-29T00:52:29.868569 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
157
+ I, [2019-06-29T00:52:29.869994 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
158
+ I, [2019-06-29T00:52:29.871558 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/custom_post.yml
159
+ I, [2019-06-29T00:52:29.872561 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
160
+ I, [2019-06-29T00:52:29.873925 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
161
+ I, [2019-06-29T00:52:29.874329 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
162
+ I, [2019-06-29T00:52:29.877551 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
163
+ I, [2019-06-29T00:52:29.877670 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/externalDocs.yml
164
+ I, [2019-06-29T00:52:29.878309 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
165
+ I, [2019-06-29T00:52:29.878477 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/account_user_role.yml
166
+ I, [2019-06-29T00:52:29.878635 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/custom_post.yml
167
+ I, [2019-06-29T00:52:29.878778 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/user/new/200/get.yml
168
+ I, [2019-06-29T00:52:29.878955 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/user.yml
169
+ I, [2019-06-29T00:52:29.879127 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/account.yml
170
+ I, [2019-06-29T00:52:29.879270 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/task.yml
171
+ I, [2019-06-29T00:52:29.879441 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/engine.yml
172
+ I, [2019-06-29T00:52:29.879621 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/main.yml
173
+ I, [2019-06-29T00:52:29.879767 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/post.yml
174
+ I, [2019-06-29T00:52:29.879960 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/info.yml
175
+ I, [2019-06-29T00:52:29.880072 #16277] INFO -- : Use schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/servers.yml
176
+ I, [2019-06-29T00:52:29.926654 #16277] INFO -- : [Generate Swagger docs from schema files] end
177
+
178
+ wait for single trap ...
179
+ ```
180
+
181
+ When you press `Ctrl + C` after edit schema ,
182
+
183
+ ```
184
+ ^C
185
+ ^CI, [2019-06-29T00:55:38.492337 #16277] INFO -- : [Analyze Swagger file] start
186
+ I, [2019-06-29T00:55:38.494113 #16277] INFO -- : [Analyze Swagger file (paths)] start
187
+ I, [2019-06-29T00:55:38.503677 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/main.yml
188
+ I, [2019-06-29T00:55:38.504894 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/rails_admin/engine.yml
189
+ I, [2019-06-29T00:55:38.509686 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/account_user_role.yml
190
+ I, [2019-06-29T00:55:38.522787 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/account.yml
191
+ I, [2019-06-29T00:55:38.532995 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/user.yml
192
+ I, [2019-06-29T00:55:38.537879 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/post.yml
193
+ I, [2019-06-29T00:55:38.542680 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v1/task.yml
194
+ I, [2019-06-29T00:55:38.548333 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/custom_post.yml
195
+ I, [2019-06-29T00:55:38.552802 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/api/v2/post.yml
196
+ I, [2019-06-29T00:55:38.560056 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/task.yml
197
+ I, [2019-06-29T00:55:38.566850 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/paths/user.yml
198
+ I, [2019-06-29T00:55:38.566886 #16277] INFO -- : [Analyze Swagger file (paths)] end
199
+ I, [2019-06-29T00:55:38.567852 #16277] INFO -- : [Analyze Swagger file (tags)] start
200
+ I, [2019-06-29T00:55:38.569655 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/tags.yml
201
+ I, [2019-06-29T00:55:38.569691 #16277] INFO -- : [Analyze Swagger file (tags)] end
202
+ I, [2019-06-29T00:55:38.569708 #16277] INFO -- : [Analyze Swagger file (components)] start
203
+ I, [2019-06-29T00:55:38.569724 #16277] INFO -- : [Analyze Swagger file (components/schemas)] start
204
+ I, [2019-06-29T00:55:38.570894 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/account.yml
205
+ I, [2019-06-29T00:55:38.571540 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/account_user_role.yml
206
+ I, [2019-06-29T00:55:38.572217 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/custom_post.yml
207
+ I, [2019-06-29T00:55:38.573028 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/engine.yml
208
+ I, [2019-06-29T00:55:38.573710 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/main.yml
209
+ I, [2019-06-29T00:55:38.574328 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/post.yml
210
+ I, [2019-06-29T00:55:38.575088 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/task.yml
211
+ I, [2019-06-29T00:55:38.575687 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/user.yml
212
+ I, [2019-06-29T00:55:38.576485 #16277] INFO -- : Write schema file: /Users/yukihirop/RubyProjects/r2-oas/oas_docs/src/components/schemas/user/new/200/get.yml
213
+ I, [2019-06-29T00:55:38.576518 #16277] INFO -- : [Analyze Swagger file (components/schemas)] end
214
+ I, [2019-06-29T00:55:38.576535 #16277] INFO -- : [Analyze Swagger file (components/requestBodies)] start
215
+ I, [2019-06-29T00:55:38.576852 #16277] INFO -- : [Analyze Swagger file (components/requestBodies)] end
216
+ I, [2019-06-29T00:55:38.576867 #16277] INFO -- : [Analyze Swagger file (components)] end
217
+ I, [2019-06-29T00:55:38.580873 #16277] INFO -- : [Analyze Swagger file] end
218
+ I, [2019-06-29T00:55:38.587586 #16277] INFO -- : [R2-OAS] end
219
+ ```