Browse Source

fixed dependency and updated readme

pull/76/head
magicmilo 3 years ago
parent
commit
5699c90e06
  1. 2
      Gemfile
  2. 3
      Gemfile.lock
  3. 2
      README.md
  4. 5
      lib/tasks/form_definition.rake
  5. 0
      lib/tasks/json_schema_validation.rb

2
Gemfile

@ -29,6 +29,8 @@ gem "discard"
gem "activeadmin"
# Admin charts
gem "chartkick"
#Json Schema
gem "json-schema"
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console

3
Gemfile.lock

@ -196,6 +196,8 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json-schema (2.8.1)
addressable (>= 2.4)
kaminari (1.2.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.1)
@ -398,6 +400,7 @@ DEPENDENCIES
govuk_design_system_formbuilder
hotwire-rails
jbuilder (~> 2.7)
json-schema
listen (~> 3.3)
overcommit (>= 0.37.0)
pg (~> 1.1)

2
README.md

@ -166,7 +166,7 @@ To validate the form JSON against the schema you can run:
`rake form_definition:validate`
This will run:
`ruby app/helpers/json_schema_validation.rb`
`ruby lib/tasks/json_schema_validation.rb`
This will validate all forms in:
directories = ["config/forms", "spec/fixtures/forms"]

5
lib/tasks/form_definition.rake

@ -1,6 +1,9 @@
# require "app/helpers/json_schema_validation.rb"
namespace :form_definition do
desc "Validate JSON against Generic Form Schema"
task :validate do
ruby "app/helpers/json_schema_validation.rb"
puts "#{Rails.root}"
ruby "lib/tasks/json_schema_validation.rb"
end
end

0
app/helpers/json_schema_validation.rb → lib/tasks/json_schema_validation.rb

Loading…
Cancel
Save