Gi60s / openapi-enforcer

Apache License 2.0
94 stars 22 forks source link

Can't check query parameters in request.query #76

Closed hankconn closed 4 years ago

hankconn commented 4 years ago

In our implementation (nest.js / express), the query parameters are in a "query" property on the Request object -- not in the "path" property, which is what enforcer is checking:

const [ pathString, query ] = request.path.split('?');

Can support for a Request.query property be added? It is an object of key-value pairs with the parameter name/value.

Gi60s commented 4 years ago

I think we could do this. I don't think I fully understand the request though. Can you give me a more complete code example of how you'd like it to work?

hankconn commented 4 years ago

I created a PR to demonstrate the idea: https://github.com/byu-oit/openapi-enforcer/pull/77

Gi60s commented 4 years ago

Sorry I haven't acted on this yet. It's been two full days. I hope to take a look tomorrow morning.

Gi60s commented 4 years ago

Thanks for PR. That made it easier to understand what was being asked. I added documentation and tests and pushed to NPM as version 1.10.4.