faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
vivus has quit [Remote host closed the connection]
_whitelogger has joined #amber
_whitelogger_ has joined #amber
_whitelogger has quit [Remote host closed the connection]
_whitelogger has joined #amber
_whitelogger has joined #amber
_whitelogger has joined #amber
<FromGitter> <lambda2> Hello there ! I'm doing my first steps with amber (coming from rails), and I'm a bit stuck on i18n. I opened an issue to fill the documentation gaps, but in the meantime does anybody know which helpers are available in my views ?
<FromGitter> <eliasjpr> @lambda2 you should have a i18n helper
<FromGitter> <eliasjpr> @/all would like some input on this valiation library, originally created with the intention to use within an Amber project. https://github.com/eliasjpr/schema-validations
<FromGitter> <eliasjpr> The intention of the library is to normalize and provide a consice way of performing validations, not only in models but also anywhere where you would need to do validation such as params validation. It also addresses the nested params issue currently open https://github.com/amberframework/amber/issues/943
<FromGitter> <eliasjpr> There are some work (implement JSON and YAML params parsing), It supports custom validators a la Rails style.
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <Blacksmoke16> similar idea to something i did but with explicit `validation` bock vs annotations on the ivars
<FromGitter> <eliasjpr> A lot inspiration came from Dry-Validations, Rails
<FromGitter> <Blacksmoke16> the schema thing is pretty neat. could that map each param to an ivar?
<FromGitter> <eliasjpr> yes
<FromGitter> <eliasjpr> it will give you a `subject.{your schema}` ivar
<FromGitter> <eliasjpr> I have been making a lot of use of value object for requests and responses
<FromGitter> <eliasjpr> at the moment there is only support for one level of nested params ⏎ ` "address.city=NY&address.street=Sleepy Hollow&address.zip=12345"`
<FromGitter> <eliasjpr> working on adding more than one level
<FromGitter> <Blacksmoke16> gotcha
<FromGitter> <eliasjpr> let me know what your thoughts are and if you come up with any ideas please open an issue would like to explore. Trying to make Amber more type safe
<FromGitter> <Blacksmoke16> this is mostly for form data?
<FromGitter> <Blacksmoke16> couldnt you have something define a like `from_form_data` class method that would work like `from_json`
<FromGitter> <eliasjpr> form, api, anything that you would like to parse in the request
<FromGitter> <eliasjpr> since the schema is a `struct` it already comes with a form_json and from_yaml method
<FromGitter> <eliasjpr> just need to do the wiring for yaml and json
<FromGitter> <eliasjpr> and if it is form params it already can parse HTTP::Params as shown in the example
<FromGitter> <eliasjpr> more testing needed for other cases
<FromGitter> <Blacksmoke16> gotcha
<FromGitter> <lambda2> @eliasjpr thanks 🙏
<FromGitter> <vifreefly> Well, I think Granite needs some helpers for validations, like for example ActiveRecord's validations
<FromGitter> <Blacksmoke16> it does, also supports https://github.com/Blacksmoke16/CrSerializer/tree/master/docs, but the latter would require some custom handling, vs just working when you go to save
<FromGitter> <Blacksmoke16> @vifreefly
<FromGitter> <Blacksmoke16> depends on your flavor, if you like annotations or explicitly writing code
<FromGitter> <eliasjpr> just added yaml and json support
<FromGitter> <eliasjpr> 😅
<FromGitter> <vifreefly> Looks like docs on the website older than docs in the repo https://github.com/amberframework/docs
<FromGitter> <Blacksmoke16> i found some bug with the query builder, not sure what it is yet
<FromGitter> <Blacksmoke16> ah yea, i dont think it supports arrays for use with the `:in` operator
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5c313a9d12db9607e7416d06]
<FromGitter> <Blacksmoke16> nice, and it segfaults when using an array
<FromGitter> <drujensen> Ouch
<FromGitter> <drujensen> Yeah, that and nested queries is still todo
<FromGitter> <Blacksmoke16> switched back to `#all` for now