{"id":32215133,"url":"https://github.com/skbkontur/perl-jsonschema-validator","last_synced_at":"2026-02-21T00:02:56.907Z","repository":{"id":36968745,"uuid":"382338785","full_name":"skbkontur/perl-jsonschema-validator","owner":"skbkontur","description":"JSON Schema and OpenAPI data validator for Perl","archived":false,"fork":false,"pushed_at":"2022-09-30T16:20:48.000Z","size":141,"stargazers_count":7,"open_issues_count":9,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-02-05T16:48:38.351Z","etag":null,"topics":["json-schema","openapi","perl","validation","validator"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skbkontur.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-02T12:25:14.000Z","updated_at":"2025-08-22T15:27:27.000Z","dependencies_parsed_at":"2022-08-18T02:00:39.013Z","dependency_job_id":null,"html_url":"https://github.com/skbkontur/perl-jsonschema-validator","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/skbkontur/perl-jsonschema-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skbkontur%2Fperl-jsonschema-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skbkontur%2Fperl-jsonschema-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skbkontur%2Fperl-jsonschema-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skbkontur%2Fperl-jsonschema-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skbkontur","download_url":"https://codeload.github.com/skbkontur/perl-jsonschema-validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skbkontur%2Fperl-jsonschema-validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29476294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T10:25:47.032Z","status":"ssl_error","status_checked_at":"2026-02-15T10:25:01.815Z","response_time":118,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json-schema","openapi","perl","validation","validator"],"created_at":"2025-10-22T07:35:17.813Z","updated_at":"2026-02-21T00:02:56.862Z","avatar_url":"https://github.com/skbkontur.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nJSONSchema::Validator - Validator for JSON Schema Draft4/Draft6/Draft7 and OpenAPI Specification 3.0\n\n# VERSION\n\nversion 0.011\n\n# SYNOPSIS\n\n    # to get OpenAPI validator in YAML format\n    $validator = JSONSchema::Validator-\u003enew(resource =\u003e 'file:///some/path/to/oas30.yml');\n    my ($result, $errors, $warnings) = $validator-\u003evalidate_request(\n        method =\u003e 'GET',\n        openapi_path =\u003e '/user/{id}/profile',\n        parameters =\u003e {\n            path =\u003e {\n                id =\u003e 1234\n            },\n            query =\u003e {\n                details =\u003e 'short'\n            },\n            header =\u003e {\n                header =\u003e 'header value'\n            },\n            cookie =\u003e {\n                name =\u003e 'value'\n            },\n            body =\u003e [$is_exists, $content_type, $data]\n        }\n    );\n    my ($result, $errors, $warnings) = $validator-\u003evalidate_response(\n        method =\u003e 'GET',\n        openapi_path =\u003e '/user/{id}/profile',\n        status =\u003e '200',\n        parameters =\u003e {\n            header =\u003e {\n                header =\u003e 'header value'\n            },\n            body =\u003e [$is_exists, $content_type, $data]\n        }\n    )\n\n    # to get JSON Schema Draft4/Draft6/Draft7 validator in JSON format\n    $validator = JSONSchema::Validator-\u003enew(resource =\u003e 'http://example.com/draft4/schema.json')\n    my ($result, $errors) = $validator-\u003evalidate_schema($object_to_validate)\n\n# DESCRIPTION\n\nOpenAPI specification and JSON Schema Draft4/Draft6/Draft7 validators with minimum dependencies.\n\n# METHODS\n\n## new\n\nCreates one of the following validators: JSONSchema::Validator::Draft4, JSONSchema::Validator::Draft6, JSONSchema::Validator::Draft7, JSONSchema::Validator::OAS30.\n\n    my $validator = JSONSchema::Validator-\u003enew(resource =\u003e 'file:///some/path/to/oas30.yml');\n    my $validator = JSONSchema::Validator-\u003enew(resource =\u003e 'http://example.com/draft4/schema.json');\n    my $validator = JSONSchema::Validator-\u003enew(schema =\u003e {'$schema' =\u003e 'path/to/schema', ...});\n    my $validator = JSONSchema::Validator-\u003enew(schema =\u003e {...}, specification =\u003e 'Draft4');\n\nif parameter `specification` is not specified then type of validator will be determined by `$schema` key\nfor JSON Schema Draft4/Draft6/Draft7 and by `openapi` key for OpenAPI Specification 3.0 in `schema` parameter.\n\nParameters:\n\n- resources\n\n    To get schema by uri\n\n- schema\n\n    To get explicitly specified schema\n\n- specification\n\n    To specify specification of schema\n\n- validate\\_schema\n\n    Do not validate specified schema\n\n- base\\_uri\n\n    To specify base uri of schema.\n    This parameter used to build absolute path by relative reference in schema.\n    By default `base_uri` is equal to the resource path if the resource parameter is specified otherwise the `$id` key in the schema.\n\nAdditional parameters need to be looked at in a specific validator class.\nCurrently there are validators: JSONSchema::Validator::Draft4, JSONSchema::Validator::Draft6, JSONSchema::Validator::Draft7, JSONSchema::Validator::OAS30.\n\n## validate\\_paths\n\nValidates all files specified by path globs.\n\n    my $result = JSONSchema::Validator-\u003evalidate_paths(['/some/path/to/openapi.*.yaml', '/some/path/to/jsonschema.*.json']);\n    for my $file (keys %$result) {\n        my ($res, $errors) = @{$result-\u003e{$file}};\n    }\n\n## validate\\_resource\n\n## validate\\_resource\\_schema\n\n# CAVEATS\n\n## YAML \u0026 booleans\n\nWhen reading schema definitions from YAML, please note that the standard\nbehaviour of [YAML::PP](https://metacpan.org/pod/YAML%3A%3APP) and [YAML::XS](https://metacpan.org/pod/YAML%3A%3AXS) is to read values which evaluate\nto `true` or `false` in a perl context. These values have no recognizable\n'boolean type'. This is insufficient for JSON schema validation.\n\nTo make the YAML readers and booleans work with `JSONSchema::Validator`,\nyou need to use the `JSON::PP` (included in Perl's standard library) module\nas follows:\n\n    # for YAML::PP\n    use YAML::PP;\n\n    my $reader = YAML::PP-\u003enew( boolean =\u003e 'JSON::PP' );\n    # from here, you can freely use the reader to\n    # read \u0026 write booleans as 'true' and 'false'\n\n\n    # for YAML::XS\n    use YAML::XS;\n\n    my $reader = YAML::XS-\u003enew;\n\n    # and whenever you read YAML with this reader, do:\n    my $yaml = do {\n      local $YAML::XS::Boolean = 'JSON::PP';\n      $reader-\u003eLoad($string); # or $reader-\u003eLoadFile('filename');\n    };\n\nThis isn't a problem when you use the `resource` argument to the\n`JSONSchema::Validator::new` constructor, but if you read your own\nschema and use the `schema` argument, this is something to be aware of.\n\n## allow\\_bignum =\u003e 1\n\nThe `allow_bignum =` 1\u003e setting (available on [JSON::XS](https://metacpan.org/pod/JSON%3A%3AXS) and\n[Cpanel::JSON::XS](https://metacpan.org/pod/Cpanel%3A%3AJSON%3A%3AXS)) on deserializers is not supported.\n\nWhen deserializing a request body with a JSON parser configured with\n`allow_bignum =` 1\u003e, floats - even ones which fit into the regular\nfloat ranges - will be deserialized as `Math::BigFloat`. Similarly,\nintegers outside of the internal integer range are deserialized as\n`Math::BigInt`. Numbers represented as `Math::Big*` objects are not\nrecognized as actual numbers and will fail validation.\n\n# AUTHORS\n\n- Alexey Stavrov \u003clogioniz@ya.ru\u003e\n- Ivan Putintsev \u003cuid@rydlab.ru\u003e\n- Anton Fedotov \u003ctosha.fedotov.2000@gmail.com\u003e\n- Denis Ibaev \u003cdionys@gmail.com\u003e\n- Andrey Khozov \u003candrey@rydlab.ru\u003e\n\n# CONTRIBUTORS\n\n- Erik Huelsmann \u003cehuels@gmail.com\u003e\n- James Waters \u003cjames@jcwaters.co.uk\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is Copyright (c) 2021 by Alexey Stavrov.\n\nThis is free software, licensed under:\n\n    The MIT (X11) License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskbkontur%2Fperl-jsonschema-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskbkontur%2Fperl-jsonschema-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskbkontur%2Fperl-jsonschema-validator/lists"}