Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't seem to work with named parameters (ie /user/:name) #54

Open
natcl opened this issue Oct 12, 2017 · 1 comment
Open

Doesn't seem to work with named parameters (ie /user/:name) #54

natcl opened this issue Oct 12, 2017 · 1 comment

Comments

@natcl
Copy link

natcl commented Oct 12, 2017

When adding an endpoint with a parameter, something like /user/:name it doesn't seem to be picked up by the doc.

@shrickus
Copy link

Nat, I was seeing something similar, but now it seems to be working fine. I think the confusing thing for me was the order of operations: when I added /:type to the end of my url path and switched to the Parameters tab, the new param did not show up right away. Once I saved the node (and maybe deployed?), then when I re-opened the node config, and selected Docs -> Edit, the new param was shown. Is this what you are seeing as well?

What I'm trying to figure out now (using your url example) is how to use the same http in node to handle both the /user and /user/nat urls -- effectively specifying that the :name param is optional. From what I've read, it looks like that is not supported directly by express (the server would need both urls added to its path list). Of course, I could just copy the http in node and change the url, but it would be nice if that was not necessary. I'm wondering if the node-red swagger node could be enhanced to provide both url paths to the express server, perhaps using some optional syntax like /users/:name? -- or at least an "Optional?" checkbox on the param itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants