aCatalogEntry function

CatalogEntry aCatalogEntry({
  1. ErrorPortal portal = ErrorPortal.localError,
  2. required String id,
  3. String version = 'v1',
  4. String title = 'Entity not found',
  5. int status = 404,
  6. bool recoverable = false,
  7. Map<String, Object?> dataSchema = const <String, Object?>{},
  8. List<CatalogEndpoint> endpoints = const <CatalogEndpoint>[],
})

Builds a CatalogEntry whose type URI is minted by the single-source builder, so catalog fixtures stay consistent with the runtime registry.

Implementation

CatalogEntry aCatalogEntry({
  ErrorPortal portal = ErrorPortal.localError,
  required String id,
  String version = 'v1',
  String title = 'Entity not found',
  int status = 404,
  bool recoverable = false,
  Map<String, Object?> dataSchema = const <String, Object?>{},
  List<CatalogEndpoint> endpoints = const <CatalogEndpoint>[],
}) {
  return CatalogEntry(
    id: id,
    typeUri: problemTypeUri(portal: portal, version: version, id: id),
    title: title,
    status: status,
    recoverable: recoverable,
    dataSchema: dataSchema,
    endpoints: endpoints,
  );
}