seomoz / interpol

A toolkit for working with API endpoint definition files, giving you a stub app, a schema validation middleware, and browsable documentation.
MIT License
187 stars 17 forks source link

Strict EndpointDefinition#path_params, #query_params #32

Open jwfearn opened 11 years ago

jwfearn commented 11 years ago

The schema values accessed via EndpointDefinition#path_params and EndpointDefinition#query_params methods are not JSON Schema 3 or 4 compliant.

I believe the fix is to add the following after https://github.com/seomoz/interpol/blob/master/lib/interpol/endpoint.rb#L203:

make_schema_strict!(@path_params)
make_schema_strict!(@query_params)

related issue: https://github.com/seomoz/interpol/issues/30

jwfearn commented 11 years ago

Another suggestion: It would be cool if EndpointDefinition#make_schema_strict! (or some variant thereof) was a public class method (it's currently a private instance method). It could be pretty useful on its own.