[RUBY] [Solution] A memo that I had a hard time because the format of sinatra-validation changed

problem

When I diverted the sinatra app I made a while ago, an error occurred in validation.

Conclusion

It seems that the version of dry-validation has changed and the format has changed.

Diversion source code

post '/hoge' do
    validates {
        required(:fuga).filled(:string).format?(DATE_FORMAT)
    }
    ...
    200
end

Modified code

post '/hoge' do
    validates{
        params{
            required(:fuga).filled(:string, format?: DATE_FORMAT)
        }
    }
    ...
    200
end

Other

Recommended Posts

[Solution] A memo that I had a hard time because the format of sinatra-validation changed
The story that docker had a hard time
I had a hard time installing MariaDB 10.5.5 on CentOS 8 of Sakura VPS
Android: I had a hard time displaying the HTML file on the SD card
A story that I had a hard time trying to build PHP 7.4 on GCE's CentOS 8
A memo that containerizes the simple chat application of Node.js + socket.io
A memo that was soberly addicted to the request of multipart / form-data
A memo when you want to clear the time part of the calendar
I had a hard time doing Java multithreading from scratch, so organize it
Set the time of LocalDateTime to a specific time
I tried to make an app that allows you to post and chat by genre ~ Where I had a hard time ~
A collection of RSpecs that I used frequently
left4dead2 I made a Docker image for the server and tried running it on GCE # 3 (I had a hard time building the server)
[Ruby] I want to make a program that displays today's day of the week!
[Must-see for beginners] I changed the display of the posting time to Japanese time [l method]
A memorandum because I was addicted to the setting of the Android project of IntelliJ IDEA
At the time of dialogReturn event, I checked because it is not updated even if I specify a component with update
I summarized the display format of the JSON response of Rails
I wrote a sequence diagram of the j.u.c.Flow sample
I learned about the existence of a gemspec file
A note that I had trouble when trying to use nginx with Remote-Containers of vscode
A memo of the program that allows you to realize that the probability of dice rolling is about 1/6
A story that I realized that I had to study as an engineer in the first place
I tried a puzzle that can only be solved by the bottom 10% of bad engineers