Skip to content

An RFC7807 Problem Details document with basic type checking and autocomplete

License

Notifications You must be signed in to change notification settings

mountain-pass/problem-document

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

problem-document

A basic RFC7807 Problem Details document with basic type checking and autocomplete

License npm npm downloads FOSSA Status

Build Status GitHub issues GitHub pull requests

source code vulnerabilities npm package vulnerabilities

Conventional Commits code style: prettier Contributor Covenant

I love badges

Installation

npm

run the following command in your project

npm install @mountainpass/problem-document

yarn

run the following command in your project

yarn add @mountainpass/problem-document

projen

Add @mountainpass/problem-document to your deps in your .projen.js or projen.ts. e.g.

///...
const project = new NodeProject({
    //...
    deps: [
        //...
        '@mountainpass/problem-document'
    ]
});

and run npx projen

Usage

import { ProblemDocument } from "@mountainpass/problem-document";

//...
const problemDocument = new ProblemDocument({
    type: "https://example.com/probs/out-of-credit",
    title: "You do not have enough credit.",
    detail: "Your current balance is 30, but that costs 50.",
    instance: "/account/12345/msgs/abc",
    balance: 30,
    accounts: ["/account/12345",
                 "/account/67890"]
  });

About

An RFC7807 Problem Details document with basic type checking and autocomplete

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published