Skip to content

ADR: all public types in the provider's root namespace (supersedes ADR-0007); move the White List models #350

Closed

Description

@milten89

Decided by the maintainer on 2026-11-21 (in the #262 discussion): every public type of a provider package goes in the provider's root namespace, with no area namespaces for models. This is option (a) of the comparison below.

Why

  • ADR-0007 puts models and enums in area namespaces (OpenUrzednik.Nbp.Currency, .Table, .Gold; OpenUrzednik.MF.WhiteList.Search, .Check, .Status). A type that several areas share stays in the area that defines it. So a caller of WhiteListStatusClient needs using OpenUrzednik.MF.WhiteList.Search; just for VatStatus.
  • A survey of 18 established .NET SDKs and public-API clients (2026-11-21) found four layouts:
    • Everything in the root, for small libraries: Octokit, Stripe core, MongoDB.Driver, Azure AppConfiguration and KeyVault.
    • Root plus .Models, for hundreds of models: AWS, Azure.Storage.Blobs, Microsoft Graph.
    • Area namespaces, when areas are large and each has its own client: OpenAI, Anthropic.
    • A shared namespace plus areas, for many areas or packages: Twilio, the MF KSeF client, CompaniesHouse.NET.
  • The Azure SDK .NET guidelines: "Some client libraries have a relatively small number of model types, and these should keep the model types in the main namespace."
  • Each package here has about 25–35 public types, of which about 10 are models. Three of the area namespaces hold a single type, which no surveyed project does.
  • The Framework Design Guidelines say "DO NOT use the same name for a namespace and a type in that namespace". Area names like Status and Check invite exactly that.

Scope

  1. A new ADR through /adr that supersedes ADR-0007, which is released in v1.0.0 and so can't be edited.
    • It restates the whole client-API decision with the new namespace layout. Every public type of a provider goes in the root namespace: clients, interfaces, options, telemetry, log events, errors, models and enums.
    • Internal namespaces (.Common, .Dto, .Validation, …) are unaffected. The rule against public namespaces named after a kind of member stays.
    • Model names must carry their own context (VatStatusResult, AccountCheckResult, GoldPrice).
    • NBP keeps its 1.x layout until 2.0 (the follow-up issue).
    • ADR-0016's line "models go in area namespaces below it (ADR-0007)" is released too. The new ADR states the replacement, and ADR-0016 gets only the supersede link its lifecycle allows, or the maintainer decides how to handle it.
  2. Correct the accepted ADR-0023 in place, with a dated line. Its models move from .Search, .Check and .Status to OpenUrzednik.MF.WhiteList.
  3. Move the White List public models to the root namespace. The package isn't released yet (IsPackable=false), so this isn't breaking.
    • The models: Subject, SubjectPerson, VatStatus, SubjectSearchResult, SubjectsSearchResult, BatchSearchResult, BatchSearchEntry, AccountCheckResult, VatStatusResult.
    • Update PublicAPI.Unshipped.txt (CRLF), the tests, AotSmoke and the docs.
    • Mappers may stay in internal folders or namespaces. The mutation shard's strict globs must still cover them.
  4. Update every place that states the rule:
    • CLAUDE.md;
    • .claude/rules/code-conventions.md and client-api.md;
    • .claude/agents/reviewer.md, the ADR-0007 line;
    • .claude/skills/new-provider and new-endpoint;
    • CONTRIBUTING, if it mentions the rule;
    • the Architecture tests, if they check namespaces.

Done when

  • The ADR is accepted and the White List public types are all in OpenUrzednik.MF.WhiteList.
  • The build, tests, format, mutation shard, AotSmoke, pack and package_guard pass.
  • NBP is unchanged; it waits for its 2.0 issue.

Activity

  1. added
    enhancement
    provider:white-list
    on Nov 21, 2026
  2. moved this from Triage to Ready in OpenUrzednik.NETon Nov 21, 2026
  3. added this to the 1.1.0 milestone on Nov 21, 2026
  4. moved this from Ready to In progress in OpenUrzednik.NETon Nov 21, 2026
  5. moved this from In progress to Done in OpenUrzednik.NETon Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementprovider:white-list

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions