Description for @urlParam is ignored
jipis opened this issue Β· comments
I have the following
/**
* Here be my title
*
* And this is a description
*
* @urlParam {string} theParam required This should be the description. Example: its-a-string
* @urlParam {int} anotherParam This is another description
*/
server.get('/:theParam/:anotherParam', (req, res, next) => {
...
It seems that the @urlParam
parser is ... exiting early? I can't provide a screenshot for unimportant reasons. But, what I get as output in the html page here is the "URL Parameters" header followed by
theParam string
anotherParam string
It is completely ignoring everything other than the @urlParam
and the variable name tokens on those lines. The example text isn't used in the example request. The description is completely missing. required
vs not having it there makes no difference. And the type is even ignored (as the int
is showing in the doc as string
).
Okay, but you need to provide environment information. Framework, versions, etc.
Also, have you tried updating to the latest version first?
Oops, sorry.
I was looking for a template to follow to indicate all info you want/need for bug reports, but I didn't see one. Gave as much as I thought of offhand.
I'm using restify
8.5.1 with scribe-restify
1.2.0 on node
15.6.0.
Yeah, that was an oversight. π Added a template now.
Try upgrading to the latest version of the package first (1.6.0). Note that in the latest version, you don't need to add the require(...)
statement to your code anymore.
ok, I'm up to 1.8.1 now.
/**
* Decode a tinyUrl
*
* Take a tiny URL (previously generated), look it up in the database,
* and redicrect the browser to it.
*
* @urlParam {string} tinyUrlId required The id of the tinyUrl to redirect to. Example: 14e2b706-d4fc-11eb-9b30-0e285caff4d5
* @urlParam {int} foo This is made up for example purposes. Example: 41380
*/
server.get('/:tinyUrlId/:foo', (req, res, next) => {
Note how really everything other than the name of the param (to include the required/not-required, description, type, and example) is ignored.
On it.
Can you try now? Should be fixed now (v1.8.2).
Ah, fuck. I think I know what's the problem.
Okay, fixed for real this time.π 1.8.3
Fixed now π
BTW, the TS code is in the src/ folder. Generated is in dist/. I'll add a contributing guide for v2, but in the meantime, you can actually just edit the generated files if you can't find any other way.
Awesome.π
Watch out for v2, coming with more customizability and smarter inference.