Closed jipis closed 3 years ago
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) => {
Generates
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).
Erm, actually, worse. Exact same code as listed above. Upgraded to 1.8.2. And got this:
Note that "Endpoints" has become "undefined". And the entire docblock is apparently being ignored now.
Ah, fuck. I think I know what's the problem.
Okay, fixed for real this time.😅 1.8.3
Ooh, almost! The documentation itself seems to be right now. Just the example is off now. Same code as above now generates this.
Tried to take a look myself, but it looks like the code to generate 1.8.3 didn't get pushed to github.
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.
We have a winner!!
Thanks so much for your help! Good to go!
For reference, same code as before is now awesomely correctly generating
Awesome.👍
Watch out for v2, coming with more customizability and smarter inference.
I have the following
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 stringIt 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 theint
is showing in the doc asstring
).