Initialize
Since
v0.4.1, rake tasks are not automatically loaded. Please writeR2OAS.load_tasksinRakefileand load it.
API document management using r2-oas begins with the execution of this command.
After requiring a gem and Configure Rakefile in your rails project
R2OAS.load_tasks
$ bundle exec rake routes:oas:init
create oas_docs
create oas_docs/.paths
create oas_docs/plugins/helpers
create oas_docs/tasks/helpers
create oas_docs/plugins/.gitkeep
create oas_docs/plugins/helpers/.gitkeep
create oas_docs/tasks/.gitkeep
create oas_docs/tasks/helpers/.gitkeep
By default, the directory is created as follows.
$ tree -a oas_docs
oas_docs
├── .paths
├── plugins
│ ├── .gitkeep
│ └── helpers
│ └── .gitkeep
└── tasks
└── .gitkeep
└── helpers
└── .gitkeep
3 directories, 4 files
| name | description | remark |
|---|---|---|
.paths | By writing the path of the yaml file of path item in this file, you can limit the endpoint used in Swagger UI and build and deploy. | configure#paths |
plugins | Storage location for locally defined plugins. | usage/use_plugins |
plugins/helpers | This directory is used to define classes used by plugins. | |
tasks | Storage location for locally defined rake tasks. | usage/define_tasks |
tasks/helpers | This directory is for defining classes used in rake tasks. |