algorand / go-algorand

Algorand's official implementation in Go.
https://developer.algorand.org/
Other
1.35k stars 470 forks source link

Header key/value pair missing in definition files - user experience issue #1524

Open rfustino opened 4 years ago

rfustino commented 4 years ago

Suggesting Header key/value name pairs defined in the oas files for each end point. Right now the user needs to edit every end point at copy and paste the name of the name of the key or set up variables when importing to postman. Providing this in our definition files, for the key name for the token of X-Algo-API-Token , a new Algorand REST API developer would not need to look that up in the docs, and would make it easier to use. Defaulting the placeholder value to the sandbox would be a bonus, if possible. Example images attached. The image without the key/value pair is how it appears after import, the image with, is after editing each end point with the key/value needed in the header. I am creating a run in postman widget in our docs and this would also facilitate reducing maintenance efforts for devrel.

Repro steps:

Clone repository Start postman app. Hit the import button in the top left hand corner and upload algod.oas2.yml from your local clone. See images below that show missing token key/value pairs on the lower image.

Header-key-value-defaults Header-key-value-empty

See info on Parameters and Headers here: https://learning.postman.com/docs/publishing-your-api/authoring-your-documentation/#parameters-and-headers

ian-algorand commented 4 years ago

This is likely part of the rest API interface that needs to be changed, as @rfustino mentioned in the algod.oas2.yml file

winder commented 3 years ago

@rfustino if you have time to experiment with this, it looks like this is how it would be specified: https://swagger.io/docs/specification/2-0/authentication/api-keys/