{"id":13413254,"url":"https://github.com/ddymko/go-jsonerror","last_synced_at":"2025-04-11T12:38:44.938Z","repository":{"id":57496738,"uuid":"153643117","full_name":"ddymko/go-jsonerror","owner":"ddymko","description":"Small package which wraps error responses to follow jsonapi.org","archived":false,"fork":false,"pushed_at":"2019-10-09T11:56:05.000Z","size":18,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T07:55:37.413Z","etag":null,"topics":["go","golang-json","json-api","json-error","jsonapi-spec"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddymko.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-10-18T15:03:45.000Z","updated_at":"2024-09-26T15:08:01.000Z","dependencies_parsed_at":"2022-08-28T11:51:09.070Z","dependency_job_id":null,"html_url":"https://github.com/ddymko/go-jsonerror","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddymko%2Fgo-jsonerror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddymko%2Fgo-jsonerror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddymko%2Fgo-jsonerror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddymko%2Fgo-jsonerror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddymko","download_url":"https://codeload.github.com/ddymko/go-jsonerror/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248402500,"owners_count":21097331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["go","golang-json","json-api","json-error","jsonapi-spec"],"created_at":"2024-07-30T20:01:36.184Z","updated_at":"2025-04-11T12:38:44.918Z","avatar_url":"https://github.com/ddymko.png","language":"Go","readme":"# Go-JsonError\n[![Go Report Card](https://goreportcard.com/badge/github.com/ddymko/go-jsonerror)](https://goreportcard.com/report/github.com/ddymko/go-jsonerror) [![Build Status](https://travis-ci.org/ddymko/go-jsonerror.svg?branch=master)](https://travis-ci.org/ddymko/go-jsonerror) [![Coveragestatus](https://codecov.io/gh/ddymko/go-jsonerror/branch/master/graph/badge.svg)](https://codecov.io/github/ddymko/go-jsonerror?branch=master)\n[![GoDoc](https://godoc.org/github.com/ddymko/go-jsonerror?status.svg)](https://godoc.org/github.com/ddymko/go-jsonerror)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)  \n\nGo-JsonError is meant to allow us to easily create json response errors that follow the JsonApi spec.\n\n[Json API Spec](https://jsonapi.org/format/#errors)\n\n## Usuage\n\nIn order to use jsonError you will need to initliaze the ErrorJson struct. Then when you would like to add an error you must pass in a ErrorComp struct to the AddError().\n\nThis follows the jsonapi spec where the error response must return an array.\n\nHere is a basic example\n\n``` go\n\tvar err ErrorJSON\n\n\terrorComposition := ErrorComp{\n\t\tDetail: \"this is a error message\",\n\t\tCode:   \"This is the code\",\n\t\tSource: Source{\n\t\t\tPointer: \"/unit/tests\",\n\t\t},\n\t\tTitle:  \"Title Test\",\n\t\tStatus: 200,\n\t}\n\n\terr.AddError(errorComposition)\n\n\terr.Error()\n\terr.ErrorByte()\n```\n\n\n\n## Running the tests\n\nThis package is just using the standard test packge included with go. You can run the test cases with\n\n``` sh\ngo test ./...\n```\n\n\n## Contributing\n\nPlease feel free to submit any pull requests.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/ddymko/go-jsonerror/tags).\n\n## Authors\n\n* **David Dymko**\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n","funding_links":[],"categories":["JSON","Relational Databases"],"sub_categories":["Advanced Console UIs","Search and Analytic Databases","SQL 查询语句构建库","检索及分析资料库"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddymko%2Fgo-jsonerror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddymko%2Fgo-jsonerror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddymko%2Fgo-jsonerror/lists"}