Skip to content

Commit

Permalink
Update json-schema dependency
Browse files Browse the repository at this point in the history
Version 2.8.0 of the json-schema gem assumed the WIP draft 6 URI would
be "http://json-schema.org/draft-06/schema#".  It happens that it is in
fact "http://json-schema.org/draft/schema#".

This was fixed in:
voxpupuli/json-schema#376

json-schema PATCH vesion was bumped, so that version 2.8.1 include this
fix.

Instead of depending on a buggy version of this gem and using the same
wrong URI, switch to the fixed version of the gem and use the expected
URI.
  • Loading branch information
smortex committed Oct 23, 2019
1 parent 73149c5 commit d90b096
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/pdk/config/analytics_schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"definitions": {},
"$schema": "http://json-schema.org/draft-06/schema#",
"$schema": "http://json-schema.org/draft/schema#",
"$id": "http://puppet.com/schema/does_not_exist.json",
"type": "object",
"title": "The PDK Analytics YAML Schema",
Expand Down
2 changes: 1 addition & 1 deletion lib/pdk/config/json_schema_namespace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def create_missing_setting(key, _initial_value = nil)
#
# @return [JSON::Schema]
def create_empty_schema
::JSON::Schema.new({}, 'http://json-schema.org/draft-06/schema#')
::JSON::Schema.new({}, 'http://json-schema.org/draft/schema#')
end

# Lazily retrieve the JSON schema from disk for this namespace
Expand Down
2 changes: 1 addition & 1 deletion pdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'ffi', '~> 1.9.0'
spec.add_runtime_dependency 'gettext-setup', '~> 0.24'
spec.add_runtime_dependency 'hitimes', '1.3.0'
spec.add_runtime_dependency 'json-schema', '2.8.0'
spec.add_runtime_dependency 'json-schema', '~> 2.8.1'
spec.add_runtime_dependency 'json_pure', '~> 2.1.0'
spec.add_runtime_dependency 'minitar', '~> 0.6'
spec.add_runtime_dependency 'pathspec', '~> 0.2.1'
Expand Down
2 changes: 1 addition & 1 deletion spec/support/file_based_namespaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<<-SCHEMA
{
"definitions": {},
"$schema": "http://json-schema.org/draft-06/schema#",
"$schema": "http://json-schema.org/draft/schema#",
"$id": "http://puppet.com/schema/does_not_exist.json",
"type": "object",
"title": "A Schema",
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/pdk/config/json_schema_namespace_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def load_and_ignore(namespace)
<<-SCHEMA
{
"definitions": {},
"$schema": "http://json-schema.org/draft-06/schema#",
"$schema": "http://json-schema.org/draft/schema#",
"$id": "http://puppet.com/schema/does_not_exist.json",
"type": "object",
"title": "A Schema",
Expand Down Expand Up @@ -74,7 +74,7 @@ def load_and_ignore(namespace)
<<-SCHEMA
{
"definitions": {},
"$schema": "http://json-schema.org/draft-06/schema#",
"$schema": "http://json-schema.org/draft/schema#",
"$id": "http://puppet.com/schema/does_not_exist.json",
"type": "object",
"title": "A Schema",
Expand Down Expand Up @@ -104,7 +104,7 @@ def load_and_ignore(namespace)
<<-SCHEMA
{
"definitions": {},
"$schema": "http://json-schema.org/draft-06/schema#",
"$schema": "http://json-schema.org/draft/schema#",
"$id": "http://puppet.com/schema/does_not_exist.json",
"type": "object",
"title": "A propertyless Schema"
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/pdk/config/json_schema_setting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<<-SCHEMA
{
"definitions": {},
"$schema": "http://json-schema.org/draft-06/schema#",
"$schema": "http://json-schema.org/draft/schema#",
"$id": "http://puppet.com/schema/does_not_exist.json",
"type": "object",
"title": "A Schema",
Expand Down Expand Up @@ -66,7 +66,7 @@
<<-SCHEMA
{
"definitions": {},
"$schema": "http://json-schema.org/draft-06/schema#",
"$schema": "http://json-schema.org/draft/schema#",
"$id": "http://puppet.com/schema/does_not_exist.json",
"type": "object",
"title": "A Schema",
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/pdk/config/json_with_schema_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<<-SCHEMA
{
"definitions": {},
"$schema": "http://json-schema.org/draft-06/schema#",
"$schema": "http://json-schema.org/draft/schema#",
"$id": "http://puppet.com/schema/does_not_exist.json",
"type": "object",
"title": "A Schema",
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/pdk/config/schema_files_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

it 'is a valid JSON schema document' do
# The Schema Document specifies which schema version it uses
expect(schema['$schema']).to match(%r{draft-[\d]+})
expect(schema['$schema']).to match(%r{draft/schema#\z})
metaschema = JSON::Validator.validator_for_name(schema['$schema']).metaschema

expect(JSON::Validator.validate(metaschema, schema)).to be true
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/pdk/config/yaml_with_schema_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<<-SCHEMA
{
"definitions": {},
"$schema": "http://json-schema.org/draft-06/schema#",
"$schema": "http://json-schema.org/draft/schema#",
"$id": "http://puppet.com/schema/does_not_exist.json",
"type": "object",
"title": "A Schema",
Expand Down

0 comments on commit d90b096

Please sign in to comment.