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
.
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
)