surrealist
surrealist copied to clipboard
ActiveModel validations?
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.
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.
Maybe suggestion about documentation should be in separate issue?