apidoc-postman
apidoc-postman copied to clipboard
Tags
@panz3r hey thanks for the conversion utility. Looks like there are many tags that are not getting converted... like description for api and parameters when it comes to a payload (POST). Any suggestions on how to adjust code base?
Hi @scriptsure ,
Thanks for your feedback and your interest in this package.
It's been a while since I worked on this but looking at the code I noticed that it is not supported, the body is simply set to raw
type.
I'd look into this as soon as I can.
yeah thanks man appreciate it
Hi @scriptsure ,
I just release a new version of apidoc-postman
(v2.1.0
) with support to set a sample payload from the apiDoc
file.
See the updated README
to see how it should work, basically by specifing a group of Body
for the @apiParam
tag a template payload will be created based on the name
and type
.
Let me know if this helps you.
ok sure.. thanks... now i am struggling with postman because you cant secure it with some kind of basic auth. So I might go to a more Slate approach... very frustrating not to find a sensible documentation code base.
Hi @scriptsure ,
Actually if you need to setup Authentication
for a particular Endpoint commented with apiDoc
you can use the @apiPermission
tag.
apidoc-postman
will then make the following conversion:
- for
@apiPermission basic
it will setup aBasic Auth
protected call. - for any other value (e.g.
@apiPermission user
) it will setup aBearer Auth
protected call and expect auser_token
variable containing the JWT token (that you can define in yourPostman
environment).
The following apiDoc
comment
/**
* @api {get} /user/:id Read data of a User
* @apiVersion 0.3.0
* @apiName GetUser
* @apiGroup User
* @apiPermission admin
*/
will create a call to GET /user/:id
with the Bearer Auth
expecting an admin_token
JWT Token.
Let me know if this helps you.