mac- / ratify

A Hapi plugin for validating the schema of path, query, request body, and response body params using JSON-schema
MIT License
71 stars 27 forks source link

More Array Support - Convert properties for schema with multipart forms and handle arrays in query strings #43

Closed barryhammen closed 8 years ago

barryhammen commented 9 years ago

When submitting a form with fields and files, you have to use multipart/form-data instead of application/x-www-form-urlencoded. If the schema had something that required a conversion (like an array of integers), it was always being rejected by ratify.

barryhammen commented 9 years ago

Also, when a query string is defined with an array type, the items were getting dropped on the floor in generating the swagger data. This caused an error in swagger-ui because it expects all arrays to have an items property

mac- commented 9 years ago

awesome, thanks for this. I'll get this merged/published as soon as I can