aProblem function
Builds a valid Problem, defaulting to a single-source type URI.
When type is omitted, the URI is minted by problemTypeUri so test
problems never hand-format the template either.
Implementation
Problem aProblem({
ErrorPortal portal = ErrorPortal.localError,
String id = 'entity-not-found',
String version = 'v1',
String title = 'Entity not found',
int status = 404,
bool recoverable = false,
String? detail,
String? instance,
Map<String, Object?> data = const <String, Object?>{},
}) {
return Problem(
type: problemTypeUri(portal: portal, version: version, id: id),
title: title,
status: status,
detail: detail,
instance: instance,
recoverable: recoverable,
data: data,
);
}