You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now Moira API do not have any documentation. I want to see beautiful interactive documentation using OpenAPI(swagger) in this repo.
I started to create the basic structure for this task and documented PUT /api/trigger/ endpoint. I assume that community can help me with this task.
To participate you need to choose an endpoint and write it in comments it below. Then you need to fork from feature/swagger branch, implement endpoint you chose and create PR to feature/swagger branch. For easier participation I created example endpoint and recommend you to follow the files structure for creating the documentation for endpoints.
Documenting the endpoint
I recommend you to follow this process during your work:
Put the structure you want to convert to JSONSchema instead of &dto.Trigger{} and call go run go run cmd/schemagen/main.go. The schema will be printed to stdout. Convert JSON to yml using any online converter for example https://www.json2yaml.com and use it in your endpoint definition.
Commit message template
Please use this template when you will write message for your commit.
Document API using OpenAPI
Right now Moira API do not have any documentation. I want to see beautiful interactive documentation using OpenAPI(swagger) in this repo.
I started to create the basic structure for this task and documented
PUT /api/trigger/
endpoint. I assume that community can help me with this task.To participate you need to choose an endpoint and write it in comments it below. Then you need to fork from
feature/swagger
branch, implement endpoint you chose and create PR tofeature/swagger
branch. For easier participation I created example endpoint and recommend you to follow the files structure for creating the documentation for endpoints.Documenting the endpoint
I recommend you to follow this process during your work:
.go
file with your endpoint handler in https://github.com/moira-alert/moira/tree/master/api/handlerapi/{your_folder}/schemas/req_{http_method}.yml
api/{your_folder}/methods.yml
api/{your_folder}/responses/{http_method}.yml
$ref
api/main.yml
and bind it with methods description using$ref
DTO to JSONSchema converter
For easier converting I recommend you to create program at
cmd/schemagen/main.go
with following code:Put the structure you want to convert to JSONSchema instead of &dto.Trigger{} and call
go run go run cmd/schemagen/main.go
. The schema will be printed to stdout. Convert JSON to yml using any online converter for example https://www.json2yaml.com and use it in your endpoint definition.Commit message template
Please use this template when you will write message for your commit.
The text was updated successfully, but these errors were encountered: