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

Why I have to access params through req.swagger.params #35

Closed
osukaa opened this issue Feb 26, 2016 · 3 comments
Closed

Why I have to access params through req.swagger.params #35

osukaa opened this issue Feb 26, 2016 · 3 comments

Comments

@osukaa
Copy link

osukaa commented Feb 26, 2016

Hi,

Just as the question says. Is there a way that in express this could be like it normally works req.params in some type of config?

Cross-ref apigee-127/swagger-express#9

@theganyo
Copy link
Collaborator

theganyo commented Mar 1, 2016

There's a mismatch considering req.params in express don't have validation. What would happen for parameters that aren't valid?

@osukaa
Copy link
Author

osukaa commented Mar 1, 2016

Parameters should be validated by a middleware before it goes into the endpoint handler. Which is what swagger-node is doing but it's not populating the standard req.params.

@theganyo
Copy link
Collaborator

theganyo commented Mar 1, 2016

Right. But some parameters might be invalid. In addition, some might be required but allowed to be null. These possibilities can't be handled by the simple req.params key/value structure that express has.

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