Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected error message for non-existant schema file #231

Closed
perlpunk opened this issue Oct 27, 2020 · 0 comments
Closed

Unexpected error message for non-existant schema file #231

perlpunk opened this issue Oct 27, 2020 · 0 comments
Assignees
Labels

Comments

@perlpunk
Copy link

perlpunk commented Oct 27, 2020

  • JSON::Validator version: 4.10
  • Perl version: 5.26
  • Operating system: openSUSE Leap 15.1

Steps to reproduce the behavior

If the schema file is absolute, the error message is unexpected:

use JSON::Validator;
my $v = JSON::Validator->new;
$v = $v->load_and_validate_schema("/none");
__END__
Can't call method "server" on an undefined value at /usr/lib/perl5/vendor_perl/5.26.1/Mojo/Server/Daemon.pm line 55.

Expected behavior

If the file is relative, the error message is as expected:

use JSON::Validator;
my $v = JSON::Validator->new;
$v = $v->load_and_validate_schema("none");
__END__
Unable to load schema none at /usr/lib/perl5/vendor_perl/5.26.1/JSON/Validator/Store.pm line 47.

This happens since version 4.10. 4.09 is ok.

@jhthorsen jhthorsen added the bug label Oct 28, 2020
@jhthorsen jhthorsen self-assigned this Jan 24, 2021
jhthorsen pushed a commit that referenced this issue Jan 24, 2021
 - Add JSON::Validator::Schema::OpenAPIv2
   * Extends JSON::Validator::Schema::Draft4
   * Can validate OpenAPIv2 API specifiation
   * Can validate HTTP request and response
   * Can validate "Accept" and "Content-Type"
   * Can handle "discriminator"
   * Can handle "readOnly" parameters
   * Can handle collectionFormat
   * Can handle default values for parameters
   * Can convert specifiation with invalid "$ref" into a valid OpenAPIv2 specifiation
   * Will coerce query parameters and headers into arrays if needed
 - Add JSON::Validator::Schema::OpenAPIv3
   * Extends JSON::Validator::Schema::Draft201909
   * Can validate OpenAPIv3 API specifiation
   * Can validate HTTP request and response
   * Can validate "Accept" and "Content-Type"
   * Can handle "discriminator"
   * Can handle "nullable" parameters
   * Can handle "readOnly" parameters
   * Can handle "style" and "explode" for arrays and objects parameters
   * Can handle "writeOnly" parameters
   * Can handle default values for parameters
   * Will coerce query parameters and headers into arrays if needed
 - Add negotiate_content_type() utility function
 - Fix t/load-file.t on Windows #234
 - Fix not checking if input schema is a file if it has a newline #223 #233
   Contributor: David Cantrell
 - Improved error message when loading non-existing file #231
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants