Releases: SemmiDev/problem
Releases · SemmiDev/problem
v1.1.0: Enhanced HTTP Framework Integration
Enhancements
- Improved integration with modern Go HTTP frameworks (Gin, Echo, Fiber, etc.) by introducing new helper methods on the
Problemstruct. - New
.JSON()method: Returns the raw JSON[]byteencoding of the problem. - New
.Map()method: Converts the problem into amap[string]anyfor frameworks that prefer maps for dynamic builder serialization. - New
.Headers()method: Generates a standard map of recommended RFC 7807 HTTP headers (e.g.,Content-Type: application/problem+json). - Exported
ContentType: Added aproblem.ContentTypeconstant to avoid string literals across your application routing.
These changes maintain 100% backwards compatibility with existing problem.Write(w) usage.
v1.0.0: RFC 7807 Core Implementation
Release Notes: v1.0.0 (Initial Release - RFC 7807 Core Implementation)
We are excited to announce the v1.0.0 initial release of the github.com/semmidev/problem library! 🚀
This library provides a comprehensive, idiomatic, and robust Go implementation for RFC 7807 (Problem Details for HTTP APIs), standardizing how machine-readable errors are returned from your HTTP APIs.
🌟 Key Features
- Standard RFC 7807 Compliance: Full support for all standard fields (
type,title,status,detail,instance). - Custom Extensions: Easily add domain-specific arbitrary fields using the functional options API that automatically flatten into the JSON payload.
- Go Error Wrapping Compatibility: The
*Problemstruct natively implementsError()andUnwrap(), making it fully compatible with standard Goerrors.Isanderrors.As. - Pre-defined HTTP Templates: Built-in templates representing common HTTP 4xx and 5xx errors (e.g.,
problem.NotFound,problem.InternalServerError). - Fluent Options API: Clean, chainable API designed for building problem details dynamically.
- Zero Dependencies: Completely built using only the Go standard library.
📚 Example Application
This release includes a fully runnable Kanban Example Application located in the example/kanban/ directory, demonstrating:
- Clean Architecture integration.
- Translating domain/infrastructure errors into RFC 7807 boundaries.
- Integration with popular external community packages (
go-chi/chirouters andasaskevich/govalidatorstruct validation).
💻 Installation
go get github.com/semmidev/problem@v1.0.0📖 Documentation
Check out the README.md for detailed usage instructions and examples.