Skip to content

2.0: move the NBP models to the root namespace OpenUrzednik.Nbp; DefaultApiUrl as static readonly #351

Open

Description

@milten89

Follow-up to the namespace ADR, the issue this one is blocked by: move NBP's public models from its area namespaces to the root namespace OpenUrzednik.Nbp in 2.0.

Why 2.0

OpenUrzednik.Nbp shipped 1.x with .Currency, .Table and .Gold, and a type's namespace is part of its identity. TypeForwardedTo only works across assemblies, and [Obsolete] can't mark a namespace move, so the move is a binary and source break. Under ADR-0011 that means it can only ship in a major release.

Scope

  • Move these types to OpenUrzednik.Nbp:

    • from .Currency: CurrencyRate, CurrencyExchangeRates, CurrencyBuySellRate, BuySellExchangeRates;
    • from .Table: TableRate, TableBuySellRate, ExchangeRateTable, BuySellExchangeRateTable, TableType;
    • from .Gold: GoldPrice.

    Keep mappers and other internals where they are.

  • Public API files: remove the shipped lines and add the new ones to PublicAPI.Unshipped.txt.

  • Package validation: baseline suppressions (IsBaselineSuppression) are allowed while version.json carries the new major (CLAUDE.md, ADR-0011). Label the PR breaking-change.

  • Everything that mentions the old namespaces: the tests, samples/, AotSmoke, the NBP and DI READMEs (README.md, README.pl.md), and the Core README if it shows NBP usings.

  • NbpOptions.DefaultApiUrl as public static readonly string (src/OpenUrzednik.Nbp/NbpOptions.cs:17), for consistency with the White List's DefaultApiUrl/TestApiUrl (MF White List: fixes from the 1.1.0 review before the API freezes #365, maintainer's decision 2026-11-22): a const is copied into the apps that name it, so a patch with a new host wouldn't reach them without a rebuild. Changing const to static readonly breaks source that uses it as a constant (attribute arguments, switch labels, default parameter values), so it waits for 2.0. Update its PublicAPI line.

  • A migration note for the 2.0 release notes: replace the using OpenUrzednik.Nbp.Currency; / .Table; / .Gold; lines with using OpenUrzednik.Nbp;; and NbpOptions.DefaultApiUrl is no longer a constant (code that uses it in an attribute, a switch label or a default parameter value needs the literal URL instead).

Done when

NBP's public types are all in OpenUrzednik.Nbp, NbpOptions.DefaultApiUrl is static readonly, every check passes with the 2.0 baseline suppressions, and the migration note is drafted.

Activity

  1. added
    breaking-change
    provider:nbp
    on Nov 21, 2026
  2. moved this from Triage to Backlog in OpenUrzednik.NETon Nov 21, 2026
  3. added this to the 2.0.0 milestone on Nov 21, 2026
  4. changed the title [-]2.0: move the NBP models to the root namespace OpenUrzednik.Nbp[/-] [+]2.0: move the NBP models to the root namespace OpenUrzednik.Nbp; DefaultApiUrl as static readonly[/+] on Nov 22, 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

    breaking-changeprovider:nbp

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions