apiaryio / gavel.js

Validator of HTTP messages (JavaScript implementation)
MIT License
97 stars 22 forks source link

validation always pass if body is empty an object ( {} ) or an empty array ( [] ). #41

Closed tu1ly closed 8 years ago

tu1ly commented 10 years ago

body: '{}'

bodySchema: { '$schema': 'http://json-schema.org/draft-03/schema', id: '#', required: true, additionalProperties: true, type: 'object', properties: { mesage: { id: 'mesage', required: true } } }

{ results: [], realType: 'application/json', expectedType: 'application/schema+json', validator: 'JsonSchema', rawData: { length: 0 } }

honzajavorek commented 8 years ago

I believe this should be fixed by https://github.com/apiaryio/gavel.js/pull/49. If that's not true, please re-open.