Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API doc update #84

Merged
merged 3 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ However, we encourage you to set up your own server and keep control over the in

Distinguishing features of Request Baskets service:

* [RESTful API](./doc/api-swagger.yaml) to manage and configure baskets, see [Request Baskets API](https://rbaskets.in/api.html) documentation in interactive mode
* [RESTful API](./doc/rbaskets-openapi.yaml) to manage and configure baskets, see [Request Baskets API](https://rbaskets.in/api.html) documentation in interactive mode
* All baskets are protected by **unique** tokens from unauthorized access; end-points to collect requests do not require authorization though
* Individually configurable capacity for every basket
* Pagination support to retrieve collections: basket names, collected requests
Expand Down Expand Up @@ -139,7 +139,7 @@ To collect HTTP requests send them (GET, POST, PUT, DELETE, etc.) to `http://loc

To view collected requests and manage basket:
* Open basket web UI `http://localhost:55555/web/<basket_name>`
* Use [RESTful API](https://github.com/darklynx/request-baskets/blob/master/doc/api-swagger.yaml) exposed at `http://localhost:55555/baskets/<basket_name>`
* Use [RESTful API](https://github.com/darklynx/request-baskets/blob/master/doc/rbaskets-openapi.yaml) exposed at `http://localhost:55555/api/baskets/<basket_name>/...`

It is possible to forward all incoming HTTP requests to arbitrary URL by configuring basket via web UI or RESTful API.

Expand Down
3 changes: 3 additions & 0 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
margin: 0;
padding: 0;
}
img[alt=logo] {
max-height: 120px;
}
</style>
<script>
window.onload = function(event) {
Expand Down
25 changes: 16 additions & 9 deletions doc/rbaskets-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ info:
license:
name: MIT
url: https://github.com/darklynx/request-baskets/blob/master/LICENSE
x-logo:
url: https://raw.githubusercontent.com/darklynx/request-baskets/master/doc/logo.svg

servers:
- url: https://rbaskets.in
Expand All @@ -33,6 +35,11 @@ tags:
description: Configure basket HTTP responses
- name: Requests
description: Manage HTTP requests collected by basket
- name: Deprecated API
description: |
Deprecated API end-points that preceded the stable API of version `1.0.0`. Every deprecated
API operation has its own counterpart under `/api` path with backwards compatible syntax
and can be easily replaced.

# URL patterns
paths:
Expand Down Expand Up @@ -303,7 +310,7 @@ paths:
/baskets:
get:
tags:
- Baskets
- Deprecated API
summary: Get baskets
description: Fetches a list of basket names managed by service. Require master token.
operationId: getBasketNamesOld
Expand All @@ -329,7 +336,7 @@ paths:
/baskets/{name}:
post:
tags:
- Baskets
- Deprecated API
summary: Create new basket
description: Creates a new basket with this name.
operationId: createBasketOld
Expand All @@ -355,7 +362,7 @@ paths:
description: Unprocessable Entity. Basket configuration is not valid.
get:
tags:
- Baskets
- Deprecated API
summary: Get basket settings
description: Retrieves configuration settings of this basket.
operationId: getBasketConfigOld
Expand All @@ -377,7 +384,7 @@ paths:
- basket_token: []
put:
tags:
- Baskets
- Deprecated API
summary: Update basket settings
description: |
Updates configuration settings of this basket.
Expand Down Expand Up @@ -414,7 +421,7 @@ paths:
- basket_token: []
delete:
tags:
- Baskets
- Deprecated API
summary: Delete basket
description: Permanently deletes this basket and all collected requests.
operationId: deleteBasketOld
Expand All @@ -434,7 +441,7 @@ paths:
/baskets/{name}/responses/{method}:
get:
tags:
- Responses
- Deprecated API
summary: Get response settings
description: |
Retrieves information about configured response of the basket. Service will reply with this response to any
Expand All @@ -461,7 +468,7 @@ paths:
- basket_token: []
put:
tags:
- Responses
- Deprecated API
summary: Update response settings
description: |
Allows to configure HTTP response of this basket. The service will reply with configured response to any HTTP
Expand Down Expand Up @@ -492,7 +499,7 @@ paths:
/baskets/{name}/requests:
get:
tags:
- Requests
- Deprecated API
summary: Get collected requests
description: Fetches collection of requests collected by this basket.
operationId: getCollectedRequestsOld
Expand Down Expand Up @@ -520,7 +527,7 @@ paths:
- basket_token: []
delete:
tags:
- Requests
- Deprecated API
summary: Delete all requests
description: Deletes all requests collected by this basket.
operationId: deleteCollectedRequestsOld
Expand Down