Bruno Pedro's public notes


API naming conventions and code generation

Naming conventions play a crucial role in the quality of the SDK that you generate for your API. Here are some examples of naming conventions for a few API architectural styles:

If you decide to follow a different structure—or don’t follow any structure at all—the SDK you generate will be harder to use by developers. As an example, the OpenAPI operationId attribute should be named in a way that works well across the programming languages that you want to support. The OpenAPI specification even recommends that:

Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.—OpenAPI specification 3.1.0 § Operation Object

So, it’s important to pay attention to how you’re naming things on your API so consumers have the best possible experience.