Menu

#Enum

8 posts

Feed·
7 of 8 posts
FastAPI: Use Enums for Path Parameters — Endpoints That Only Accept Valid Values in 5 Minutes
📰
0Read More

FastAPI: Use Enums for Path Parameters — Endpoints That Only Accept Valid Values in 5 Minutes

DEV Community: fastapi·Linh Fish Dev·5 days ago
#Sq2OjPOb
#devtofastapi#devto#dev#enum#status

Many APIs have path parameters that only accept a few fixed values — an order status, for example. Declare the parameter as a str Enum and FastAPI rejects unknown values with a 422 on its own, generates docs with the list of choices, and removes the…

15s
TypeScript `const` Enums Are Deprecated: What to Migrate to and Why the Compiler Team Made the Call
🖼️
0Read More

TypeScript `const` Enums Are Deprecated: What to Migrate to and Why the Compiler Team Made the Call

DEV Community·jsmanifest·10 days ago
#LWaSy2rV
#dev#const#direction#enums#enum

The TypeScript compiler team deprecated const enums because they break isolated module compilation and cause runtime errors in modern build pipelines. Learn the technical reasons, migration strategies to union types and const objects, and why the dep

15s
I accidentally logged hundreds of thousands of phone calls to military bases
🖼️
0Read More

I accidentally logged hundreds of thousands of phone calls to military bases

Hacker News·3 months ago
#B6ZEhS7o

How an expired nameserver let me take over e164.arpa zones for multiple territories, and why I probably should have checked my logs sooner.

15s
PHP Enum Methods to TypeScript: Why Discriminated Unions + namespace Beats class enums
🖼️
0Read More

PHP Enum Methods to TypeScript: Why Discriminated Unions + namespace Beats class enums

DEV Community·Gabriel Anhaia·6 months ago
#DhlWFxPT
#pattern#typescript#php#orderstatus#paid

PHP enum methods to TS: discriminated union plus a same-named namespace. Three patterns and why TS enum is the wrong reach in 2026.

15s
0Read More

Adding attributes to Enum values?

Reddit r/learnpython·u/pachura3·7 months ago
#32v6YDjw
#color#enum#is_warm#auto#orange

Let's say I have enum Color and I would like it to have an additional attribute is_warm which would indicate whether given color is traditionally perceived as "warm" (red, orange, yellow...) or not.…

15s
Enums for Perl: Adopting Devel::CallParser and Building Enum::Declare
🖼️
0Read More

Enums for Perl: Adopting Devel::CallParser and Building Enum::Declare

DEV Community·LNATION·7 months ago
#O7RXWOKK
#perl#xs#programming#comment#software

Adopting one from Zefram Back in 2011, Andrew Main, known to the Perl community as Zefram, released Devel::CallParser. It was a quiet piece of infrastructure: a C API that let XS modules attach custom argument parsers to Perl subroutines.…

15s