Merge pull request #132 from dr03ramos/patch-1
Update metaschema URI format in input_schema.rb
This commit is contained in:
commit
b5e344e456
2 changed files with 8 additions and 2 deletions
|
|
@ -50,7 +50,10 @@ module MCP
|
|||
accept_uri: false,
|
||||
accept_file: ->(path) { path.to_s.start_with?(Gem.loaded_specs["json-schema"].full_gem_path) },
|
||||
)
|
||||
metaschema = JSON::Validator.validator_for_name("draft4").metaschema
|
||||
metaschema_path = Pathname.new(JSON::Validator.validator_for_name("draft4").metaschema)
|
||||
# Converts metaschema to a file URI for cross-platform compatibility
|
||||
metaschema_uri = JSON::Util::URI.file_uri(metaschema_path.expand_path.cleanpath.to_s.tr("\\", "/"))
|
||||
metaschema = metaschema_uri.to_s
|
||||
errors = JSON::Validator.fully_validate(metaschema, schema, schema_reader: schema_reader)
|
||||
if errors.any?
|
||||
raise ArgumentError, "Invalid JSON Schema: #{errors.join(", ")}"
|
||||
|
|
|
|||
|
|
@ -55,7 +55,10 @@ module MCP
|
|||
accept_uri: false,
|
||||
accept_file: ->(path) { path.to_s.start_with?(Gem.loaded_specs["json-schema"].full_gem_path) },
|
||||
)
|
||||
metaschema = JSON::Validator.validator_for_name("draft4").metaschema
|
||||
metaschema_path = Pathname.new(JSON::Validator.validator_for_name("draft4").metaschema)
|
||||
# Converts metaschema to a file URI for cross-platform compatibility
|
||||
metaschema_uri = JSON::Util::URI.file_uri(metaschema_path.expand_path.cleanpath.to_s.tr("\\", "/"))
|
||||
metaschema = metaschema_uri.to_s
|
||||
errors = JSON::Validator.fully_validate(metaschema, schema, schema_reader: schema_reader)
|
||||
if errors.any?
|
||||
raise ArgumentError, "Invalid JSON Schema: #{errors.join(", ")}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue