Skip to content

Fix the ValidationError snippet in the Core README - #180

Merged
milten89 merged 2 commits into
developfrom
docs/validation-error-snippet
Oct 30, 2026
Merged

milten89 merged 2 commits into
developfrom
docs/validation-error-snippet

Conversation

@milten89

Copy link
Copy Markdown
Owner

Closes #162

The "failed result" example called new ValidationError("NIP is invalid."), but ValidationError has one constructor, (message, ruleName, name, value), so the snippet didn't compile. #99 (PR #170) moved it from the root README into src/OpenUrzednik.Core/README.md and README.pl.md; the Core README is packed, so the broken example also showed on nuget.org. That was my mistake in #99: I compiled only the NBP quick start, not this example.

Now: new ValidationError("NIP is invalid.", ruleName: "nipChecksum", name: "nip", value: null) in both files (the same code, ADR-0009). The rule name is camelCase like the library's validators (topCount, iso4217, …), and the value stays null, so no identifier lands in the error's metadata (ADR-0003).

Checks

  • All three C# snippets in the Core README compile against src/OpenUrzednik.Core (net10.0); the EN and PL snippets are byte-identical; the fixed example runs and prints "NIP is invalid." from OpenUrzednikValidationException.
  • git grep finds no other error constructor in any README.
  • Reviewer: no blocking issue; its nit (camelCase rule name) is applied.

🤖 Generated with Claude Code

The "failed result" example called a ValidationError constructor that
doesn't exist, so it didn't compile; it moved from the root README into
the packed Core README in #99. It now uses the real constructor, with a
camelCase rule name like the library's validators and no value, so no
identifier lands in the error's metadata (ADR-0003).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milten89 milten89 added the documentation Improvements or additions to documentation label Oct 30, 2026
Matches the library's validators (topCount, iso4217, ...). The previous
commit's edit was skipped by a case-insensitive check in my script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milten89
milten89 merged commit c96d37f into develop Oct 30, 2026
10 checks passed
@milten89
milten89 deleted the docs/validation-error-snippet branch October 30, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Fix the ValidationError snippet in the root README

1 participant