Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Helper script to convert govuk specialist-publisher schema to rumager document schema
json = File.read("path/to/specialist-publisher/schema")
publisher_schema = JSON.parse(json)
fields = publisher_schema['facets'].map{|x| x['key']}
allowed_values = {}
publisher_schema['facets'].each do |facet|
allowed_values[facet['key']] = facet["allowed_values"]
end
puts({
fields: fields,
allowed_values: allowed_values
}.to_json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.