Library for JSON API input handling and validation?

I was looking for a library that allowed me to handle input from JSON input in my API's. Something that allowed me not only to hydrate into my domain objects, but also validate the input. Something like this, in pseudo-code:

class InputHandler public define() this.add('order_id', 'string'); this.add('order_date', 'datetime'); user = this.add('user', 'MyDomainUser'); user.add('name', 'string'); user.add('email', 'string'); user.add('age', 'integer'); handler = new InputHandler handler.bind(httpRequest) handler.isValid() // bool handler.get('order_id') // string handler.get('user') // MyDomainUser 

by vinnyvicious via /r/csharp

Leave a Reply