Library that implements the Problem interface. Reference https://www.rfc-editor.org/rfc/rfc7807.
npm install @asyncapi/problem
// OR
yarn add @asyncapi/problem
import { Problem } from '@asyncapi/problem';
const problem = new Problem({ type: 'https://example.com/problem', title: 'Example problem' });
console.log(problem.get('type'));
// Output:
// https://example.com/problem
import { ProblemMixin } from '@asyncapi/problem';
class MyProblem extends ProblemMixin({ typePrefix: 'https://example.com' }) {}
const problem = new MyProblem({ type: 'problem', title: 'Example problem' });
console.log(problem.get('type'));
// Output:
// https://example.com/problem
- Write code and tests in the
__tests__
folder. - Make sure all tests pass by
npm test
command. - Make sure code can be transformed to JS by
npm run build
command. - Make sure code is well formatted and secure by
npm run lint:fix
command.
Read CONTRIBUTING guide.