Skip to content

Add Supported Format Discovery #171

Description

@tiksn

Add Supported Format Discovery

Goal

Expose ROFSDB supported file extensions so consumers can discover which formats are registered in the current service provider.

Repository Context

ROFSDB discovers registered serializers by resolving keyed ISerialization services and building an extension-to-serializer map inside DatabaseEngine. That information is currently internal to DatabaseEngine, so consumers cannot inspect supported extensions without duplicating DI logic.

Implementation Guidance

  • Add a small public discovery abstraction, such as IFileFormatRegistry, rather than expanding IDatabaseEngine unless there is a clear compatibility reason.
  • Populate the registry from registered keyed ISerialization services.
  • Expose supported extensions and, if useful, serializer display names.
  • Normalize extensions with a leading dot.
  • Use case-insensitive extension handling consistent with DatabaseEngine.
  • Register the registry in ServiceCollectionExtensions.
  • Consider sharing the registry with DatabaseEngine to avoid duplicating extension-map construction.
  • Preserve existing IDatabaseEngine behavior.

Test Requirements

  • Assert the registry reports all built-in extensions.
  • Assert extension matching is case-insensitive.
  • Assert custom serializers registered by users appear in the registry.
  • Assert duplicate extension handling follows the repository's chosen duplicate-registration behavior.

Acceptance Criteria

  • Consumers can query supported extensions through DI.
  • Existing document reading behavior remains unchanged.
  • The feature works with custom serializers.
  • dotnet test passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions