Enum query-string parameters and route segments take declared names only #329

Merged
claude merged 3 commits from feature/327-query-enum-names into develop 2026-11-05 20:31:30 -05:00
Owner

Enum query-string parameters and route segments accept declared names only (decision Q-API-3 on #260, rule as Q-API-1). Digit strings and undefined values answer 400 with errors.<param> listing the valid names.

  • New EnumNameModelBinder and provider, inserted first in ModelBinderProviders. They cover enum and nullable-enum parameters bound from the query, the route or no attribute. Body, form and header bindings are untouched, and future parameters are covered automatically.
  • Affected today:
    • GET /api/clients: presence, sort.
    • GET /api/dhcp-option-catalog: protocolVersion.
    • POST /api/dhcp-services/{kind}/start|stop: kind.
    • QueryLogController already parsed names only.
  • A missing or blank value stays unbound. A repeated parameter is refused if any of its values is not a name.
  • The new internal RequestEnumNames holds the name table and the matching for both the body converter (#323) and the binder, so query, route and body accept the same spellings, wire aliases included.
  • The DhcpServiceKindEnum description changed. The OpenAPI snapshot and the Angular client are regenerated in their own commit (one line each).
  • The CHANGELOG entry and the README REST API bullet now cover query parameters and route segments.

Verified: two verifier passes. Red without the registration is 17 of 38. Build has 0 warnings, csharpier is clean, and Ninlil.Web.Tests passes (2276, without the Docker-only ones). Angular lint, build and tests pass (1648).

Closes #327

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

Enum query-string parameters and route segments accept declared names only (decision Q-API-3 on #260, rule as Q-API-1). Digit strings and undefined values answer 400 with `errors.<param>` listing the valid names. - New `EnumNameModelBinder` and provider, inserted first in `ModelBinderProviders`. They cover enum and nullable-enum parameters bound from the query, the route or no attribute. Body, form and header bindings are untouched, and future parameters are covered automatically. - Affected today: - `GET /api/clients`: `presence`, `sort`. - `GET /api/dhcp-option-catalog`: `protocolVersion`. - `POST /api/dhcp-services/{kind}/start|stop`: `kind`. - `QueryLogController` already parsed names only. - A missing or blank value stays unbound. A repeated parameter is refused if any of its values is not a name. - The new internal `RequestEnumNames` holds the name table and the matching for both the body converter (#323) and the binder, so query, route and body accept the same spellings, wire aliases included. - The `DhcpServiceKindEnum` description changed. The OpenAPI snapshot and the Angular client are regenerated in their own commit (one line each). - The CHANGELOG entry and the README REST API bullet now cover query parameters and route segments. Verified: two verifier passes. Red without the registration is 17 of 38. Build has 0 warnings, csharpier is clean, and `Ninlil.Web.Tests` passes (2276, without the Docker-only ones). Angular lint, build and tests pass (1648). Closes #327 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Closes #327

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Refs #327

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The OpenAPI snapshot and Angular API client say the DHCP service route takes declared kind names only
Some checks failed
Build / Build Binary (linux-amd64) (push) Has been skipped
Build / Build Binary (linux-arm64) (push) Has been skipped
Build / Smoke Test the Windows Binary (push) Has been skipped
Build / Build Binary (macos-amd64) (push) Has been skipped
Build / Build Binary (macos-arm64) (push) Has been skipped
Build / Build Binary (windows-amd64) (push) Has been skipped
Build / Build Arch Linux Packages (push) Has been skipped
Build / Build and Push Image (push) Has been skipped
Build / Build and Test Deb and RPM Packages (push) Has been skipped
Build / Pipeline (push) Failing after 0s
Build / Publish Release (push) Has been skipped
Build / Build Binary (linux-arm64) (pull_request) Successful in 0s
Build / Build Binary (linux-amd64) (pull_request) Successful in 2s
Build / Build Binary (macos-amd64) (pull_request) Successful in -6s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in 3m27s
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in 4m2s
Build / Build Binary (windows-amd64) (pull_request) Successful in 6m35s
Build / Build Binary (macos-arm64) (pull_request) Successful in 6m52s
Build / Build and Push Image (pull_request) Successful in -2m33s
Build / Build Arch Linux Packages (pull_request) Successful in -2m24s
Build / Smoke Test the Windows Binary (pull_request) Successful in 16s
Build / Build and Test Deb and RPM Packages (pull_request) Successful in -53s
Build / Pipeline (pull_request) Successful in 0s
Build / Publish Release (pull_request) Successful in -2m38s
Build / Test .NET (push) Failing after 15m55s
Build / Pack and Push NuGet Packages (dns-core) (push) Has been skipped
Build / Pack and Push NuGet Packages (common) (push) Has been skipped
Build / Pack and Push NuGet Packages (dns-server) (push) Has been skipped
Build / Stage Draft Release (push) Has been skipped
Build / Pack and Push NuGet Packages (dhcp) (push) Has been skipped
38f6251088
Refs #327

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit 64ef98e6cb into develop 2026-11-05 20:31:30 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil!329
No description provided.