Repository

Buy me a coffee Liberapay PayPal

problemdetail

This is a simple implementation of Problem Details for HTTP APIs RFC providing a simple struct Problem with resolvable members and serialization to JSON.

Please check examples folder for a sample or simply run make run-examples .

How to

VPM package upload is planned but currently blocked by vlang/vpm#126 . In the meantime you can use:

v install --git https://github.com/keyweeusr/problemdetail

or clone and either make local-install or build manually within your project. Then simply:

import problemdetail
problemdetail.new(
    type ?URL,
    status int,
    title string,
    detail string,
    instance ?URL
)

About

An implementation of RFC9457, Problem Details for HTTP APIs

0
1
last Jan 9

Author

KeyWeeUsr