On Sep 5, 2013, at 4:34 PM, Chris Price <notifications@github.com> wrote:

> In src/com/puppetlabs/middleware.clj:
> 
> > @@ -91,6 +105,15 @@
> >        (app req)
> >        (pl-http/error-response (str "missing " param)))))
> >  
> > +(defn verify-no-paging-params
> I discussed this with @nicklewis and we decided that the v1/v2 endpoints should not support the paging query parameters. This seemed like the easiest way to enforce and test that.
> 
> Also, I'm kind of of the opinion that it's not a good thing that we don't error if you pass unsupported query params in general; it means people can make a simple typo somewhere and end up being very confused about why things aren't behaving like they expect.
> 
> So... I guess the question is: do you feel so strongly about not enforcing the absence of these parameters that you think it's worth introducing a bunch of extra complexity to the tests?
> 
> 

I don't care that strongly about it. However, I do think that if we're going to enforce that those query params aren't there for v1/v2, then we should change the middleware to one that isn't specific to paging and instead something that takes, say, a list of optional params and mandatory params and validates the request.

That would be useful much more broadly, and could easily be extracted/adapted from the existing paging-specific code you've got.

> —
> Reply to this email directly or view it on GitHub.
>