API inputs that take an enum as text accept member names only #296
Labels
No labels
agent
api-regen
agent
architect
agent
coder
agent
console-coder
agent
docs-writer
agent
mechanic
agent
protocol-coder
agent
storage-coder
area/api
area/ci
area/console
area/dhcp
area/dns
area/docs
area/packaging
area/process
area/storage
area/windows
kind
bug
kind
chore
kind
docs
kind
epic
kind
feature
kind
performance
kind
security
kind
test
priority
high
priority
low
priority
medium
resolution
duplicate
resolution
not-a-bug
resolution
wontfix
status
blocked
status
in-progress
status
needs-decision
status
needs-design
status
ready
theme
ad-samba-dns
theme
alternatives-benchmark
theme
console-toolchain
theme
later
theme
parity-devices
theme
parity-query
theme
post-release-fixes
theme
tracker-setup
theme
valkey
theme
windows-installer
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#316 Epic: Enum fields in API request bodies accept names only
lantea-one/ninlil
#31 The access-control API accepts capability names only, never numbers
lantea-one/ninlil
Reference
lantea-one/ninlil#296
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Several API inputs parse enum text with
Enum.TryParseand noIsDefinedcheck. They accept digit strings, including numbers that are not members. #31 fixed this for access-control capabilities.DhcpTagRulesController.csParseMatchModevendorClassMatchMode,userClassMatchMode"5"is stored as an undefinedDhcpv4TagMatchModeEnumRecursiveSettingsController.cstrust-anchor overridetrustAnchorsOverride[].algorithm"200"is accepted as aDnssecAlgorithmEnumWebListenSettingsController.csandTransportSettingsController.cscertificate.allowedProtocols[]SslProtocolsis a flags enum: digits, masks such as"3072"and"Tls12, Tls13"in one entry pass, and digits are written back as numbersTransportSettingsController.csDNSCryptenabledEsVersions[]"99"passes, and the original text is stored as sentQueryLogController.csTryParseOptionalEnumqueriedType,responseCode,clientProtocolVersionquery filters"99"passes. As a read filter it only matches nothing, so this one is the lowest priority. Its EnumMember wire-name fallback must stay.What changes
SslProtocolsmembers (Ssl2,Ssl3,Tls,Default) is a separate question: keep today's behaviour for them and say so.Acceptance
OpenApiSnapshotTestspasses, or api-regen follows in the same PR if a model's text changes.Source
Found by the verifier on #31.
Ghost referenced this issue2026-11-05 14:53:06 -05:00
Ghost referenced this issue2026-11-05 14:53:06 -05:00
Ghost referenced this issue2026-11-05 19:14:49 -05:00
Ghost referenced this issue2026-11-05 19:14:49 -05:00