Skip to content

Releases: SemmiDev/problem

v1.1.0: Enhanced HTTP Framework Integration

08 Mar 22:11

Choose a tag to compare

Enhancements

  • Improved integration with modern Go HTTP frameworks (Gin, Echo, Fiber, etc.) by introducing new helper methods on the Problem struct.
  • New .JSON() method: Returns the raw JSON []byte encoding of the problem.
  • New .Map() method: Converts the problem into a map[string]any for 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 a problem.ContentType constant 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

08 Mar 06:24

Choose a tag to compare

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 *Problem struct natively implements Error() and Unwrap(), making it fully compatible with standard Go errors.Is and errors.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/chi routers and asaskevich/govalidator struct validation).

💻 Installation

go get github.com/semmidev/problem@v1.0.0

📖 Documentation

Check out the README.md for detailed usage instructions and examples.