surrealist icon indicating copy to clipboard operation
surrealist copied to clipboard

ActiveModel validations?

Open jaydanielian opened this issue 7 years ago • 2 comments

Would be great to have some way to return ActiveModel standard .errors responses when the type checking fails. Plug in to a .valid? call and return the errors collection with fields that were in breach of contract definition.

Would also love to stitch swagger spec output from this as well.

Any thoughts on these ideas? I love the concept of this lib.

jaydanielian avatar Feb 24 '18 16:02 jaydanielian

Hey @jaydanielian, thanks for the issue. As of ActiveModel validations, I don't think that a serializer should keep that logic inside, it's just not its responsibility. And concerning a documentation output, that's a good idea, I don't think it should depend on swagger or anything, just generating a documentation from a schema will do, I guess. We should give it a thought.

nesaulov avatar Feb 25 '18 18:02 nesaulov

Maybe suggestion about documentation should be in separate issue?

nulldef avatar Mar 22 '18 20:03 nulldef