{"id":15019150,"url":"https://github.com/kwakwaversal/perl5-json-api-error","last_synced_at":"2026-02-02T10:44:45.143Z","repository":{"id":56839584,"uuid":"150641839","full_name":"kwakwaversal/perl5-json-api-error","owner":"kwakwaversal","description":"JSON API-style error objects","archived":false,"fork":false,"pushed_at":"2018-10-07T15:21:47.000Z","size":9,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-17T17:50:44.914Z","etag":null,"topics":["json-api","perl","perl5"],"latest_commit_sha":null,"homepage":null,"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/kwakwaversal.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":"2018-09-27T20:07:45.000Z","updated_at":"2018-09-27T22:37:48.000Z","dependencies_parsed_at":"2022-08-29T05:00:43.933Z","dependency_job_id":null,"html_url":"https://github.com/kwakwaversal/perl5-json-api-error","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kwakwaversal/perl5-json-api-error","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwakwaversal%2Fperl5-json-api-error","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwakwaversal%2Fperl5-json-api-error/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwakwaversal%2Fperl5-json-api-error/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwakwaversal%2Fperl5-json-api-error/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kwakwaversal","download_url":"https://codeload.github.com/kwakwaversal/perl5-json-api-error/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwakwaversal%2Fperl5-json-api-error/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29010602,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T10:37:29.253Z","status":"ssl_error","status_checked_at":"2026-02-02T10:37:28.644Z","response_time":58,"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-api","perl","perl5"],"created_at":"2024-09-24T19:53:04.629Z","updated_at":"2026-02-02T10:44:45.093Z","avatar_url":"https://github.com/kwakwaversal.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nJSON::API::Error - JSON API-style error objects\n\n# SYNOPSIS\n\n    use JSON::API::Error;\n    use Mojo::JSON qw/encode_json/;\n\n    # A JSON API error representing bad submission data\n    my $err = JSON::API::Error-\u003enew({\n        source =\u003e {pointer =\u003e '/forename'},\n        status =\u003e '400',\n        title  =\u003e 'Field required',\n    });\n\n    # Field required\n    say $err-\u003etitle;\n    # /forename: Field required\n    say \"$err\";\n\n    # {\n    #   \"source\": {\n    #     \"pointer\": \"/forename\"\n    #   },\n    #   \"status\": \"400\",\n    #   \"title\": \"Field required\"\n    # }\n    say encode_json $err;\n    say encode_json $err-\u003eTO_JSON;\n\n    # A JSON API error representing a missing resource\n    my $err = JSON::API::Error-\u003enew({\n        status =\u003e '404',\n        title  =\u003e 'Not Found',\n    });\n\n    # {\n    #   \"status\": \"404\",\n    #   \"title\": \"Not Found\"\n    # }\n    say encode_json $err;\n    say encode_json $err-\u003eTO_JSON;\n\n# DESCRIPTION\n\n[JSON::API::Error](https://metacpan.org/pod/JSON::API::Error) provides a [JSON API error object](http://jsonapi.org/format/#error-objects).\nIt is intended to provide a consistent error interface that can be digested by\nfront and backend software.\n\nThe front end will receive an `ARRAY` of these objects when there is an error.\nIt should contain enough information to be able to add custom errors to specific\nform elements.\n\n# ATTRIBUTES\n\n[JSON::API::Error](https://metacpan.org/pod/JSON::API::Error) implements the following attributes.\n\n## code\n\nAn application-specific error code, expressed as a string value.\n\n## detail\n\nA human-readable explanation specific to this occurrence of the problem. Like\n`title`, this field's value can be localized.\n\n## id\n\nA unique identifier for this particular occurrence of the problem.\n\n## links\n\nA [links object](http://jsonapi.org/format/#document-links) containing the\nfollowing members:\n\n**about**: a link that leads to further details about this particular occurrence\nof the problem.\n\n## meta\n\n    my $err = JSON::API::Error-\u003enew(\n        {\n            meta =\u003e {\n                length =\u003e 5,\n                detail =\u003e \"Field length is 5, should be at least 30\"\n            },\n            source =\u003e {pointer =\u003e \"/forename\"},\n            status =\u003e '400',\n            title  =\u003e \"Field length\",\n        }\n    );\n\nA meta object containing non-standard meta-information about the error. Can be\nused to include more detail about the error.\n\n## source\n\nAn object containing references to the source of the error, optionally including\nany of the following members:\n\n**pointer**: a JSON Pointer \\[RFC6901\\] to the associated entity in the request\ndocument \\[e.g. \"/data\" for a primary data object, or \"/data/attributes/title\"\nfor a specific attribute\\].\n\n**parameter**: a string indicating which URI query parameter caused the error.\n\n## status\n\nThe HTTP status code applicable to this problem, expressed as a string value.\n\n## title\n\nA short, human-readable summary of the problem that SHOULD NOT change from\noccurrence to occurrence of the problem, except for purposes of localization.\n\n# METHODS\n\n[JSON::API::Error](https://metacpan.org/pod/JSON::API::Error) implements the following methods.\n\n## TO\\_JSON\n\nReturns the object instance as a `HASH` reference, suitable for encoding to\n`JSON`.\n\n# OPERATORS\n\n[JSON::API::Error](https://metacpan.org/pod/JSON::API::Error) overloads the following operators.\n\n## bool\n\n    my $bool = !!$err;\n\nAlways true.\n\n## stringify\n\n    my $str = \"$err\";\n\nAlias for `to_string`.\n\n# AUTHOR\n\nPaul Williams \u003ckwakwa@cpan.org\u003e\n\n# COPYRIGHT\n\nCopyright 2018- Paul Williams\n\n# LICENSE\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n\n# SEE ALSO\n\n[https://metacpan.org/pod/Mojolicious::Plugin::OpenAPI](https://metacpan.org/pod/Mojolicious::Plugin::OpenAPI),\n[http://jsonapi.org/](http://jsonapi.org/),\n[http://jsonapi.org/format/#errors](http://jsonapi.org/format/#errors).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwakwaversal%2Fperl5-json-api-error","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwakwaversal%2Fperl5-json-api-error","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwakwaversal%2Fperl5-json-api-error/lists"}