CodeX
Published in

CodeX

Should your API use enums?

Enumerated values are a clever validation technique that can be risky for an API

Enumerated values are a great way to use type safety to your advantage. They make otherwise tricky-to-remember numbers or strings easy to use. Unfortunately they can also pose risks for API developers.

I was a big fan of enums when my team designed the AvaTax REST API; but I’d like to share with you the problems that we faced and why our team has generally reduced our usage of enums when we designed the Lockstep Platform API. Let’s break this down.

--

--

--

Everything connected with Tech & Code. Follow to join our 900K+ monthly readers

Recommended from Medium

Two Time Saving Tips For Beginner Programmers

Make wise PIDs in GaragePro

What Is CI/CD and Why You Should Be Using It

Python Basics 2 — Variables and Types

Get started with platform CI/CD Jenkins-Nexus- Gitlab PART 2

Analyzing cloud identities using the AWS SDK

Serving WordPress using Apache on Ubuntu 20.04.3 LTS

The First Computer Programmer in the world was a Woman

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ted Spence

Ted Spence

Software development management, focusing on analytics and effective programming techniques.

More from Medium

Building a Platform: Part 2

How I Implement Hexagonal Architecture in AWS Lambda

Managing User Sessions and OpenID Connect Logout

Speed, quality, or cheap software?