Add /operations endpoint to list available operations#17
Add /operations endpoint to list available operations#17Boolean263 wants to merge 2 commits intogchq:masterfrom
Conversation
This is a straightforward change to add a `/operations` endpoint which can be used to get a list of the available operations on the CyberChef server. The returned object has an attribute for each operation name, with the argument description as its value. This change also documents this new endpoint in `README.md` and `swagger.yml`.
d98762625
left a comment
There was a problem hiding this comment.
This is great, thank you @Boolean263.
Could you please address:
- Minor documentation comments inline
- Add some tests covering the output of your new endpoint (basic "it exists" and maybe the existence of a couple of operation properties)
Much appreciated, thanks a lot 🙌
| > For full documentation of the API, you can find the swagger page hosted at the root url. See [Installing](#Installing) to run the application and browse the docs. | ||
|
|
||
| Currently the server just has one endpoint: `/bake`. This endpoint accepts a POST request with the following body: | ||
| The most important endpoint is `/bake`. This endpoint accepts a POST request with the following body: |
There was a problem hiding this comment.
Could you make this part of the README a list of endpoints with anchor tags to their respective parts of the documentation please?
|
|
||
| There is also a `/operations` endpoint. This endpoint accepts a GET request and responds with a JSON object listing the available operations on this server. Each operation name is one attribute, and its value is the description of the arguments it can take. | ||
|
|
||
| #### Example: operation list |
There was a problem hiding this comment.
Can you add a section for /operations and put this example under it please
| /** | ||
| * operationsGet | ||
| */ | ||
| router.get("/", async (req, res, next) => { |
There was a problem hiding this comment.
a bit of a nit: please could you make this function a function rather than an arrow function, just for consistency please.
| type: object | ||
| example: > | ||
| { | ||
| "FromBase64" : { |
There was a problem hiding this comment.
Please can you define the example response in YAML rather than a string that looks like JSON please. there should be an example of this in swagger.yml now that the magic operation docs are included
|
I got all your requested changes done, but I couldn't cleanly rebase my changes on master because of other changes you've made. I've set up a fresh pull request (#22) instead. |
This is a straightforward change to add a
/operationsendpoint whichcan be used to get a list of the available operations on the CyberChef
server. The returned object has an attribute for each operation name,
with the argument description as its value.
This change also documents this new endpoint in
README.mdandswagger.yml.