defining schemas in the controllers would be too messy I think, so we could have some simpler and more concise API that would set up validation schemas behind the scenes and cache them (rebuilding schemas on each request makes no sense)
What I do in rails w/ dry-validation is set up a validations folder with schemas in it. What do you think the advantage would be setting them up behind the scenes?
#is an alias
Serialize) which will receive object that needs to be serialized and mapper as
Serialize) object in
corecontainer or in API sub-app container? I’m in doubt since looking at berg, all “wrappers” are a part of core component, however, in this case, serialization will be performed only for sub-app.
require "yaks" module Main class JsonSerializer Serializer = Yaks.new do # yaks config here end def call(*args) Serializer.call(*args) end end end
JsonSerializerbasically just “wraps” the yaks instance