I’m working on an API project using RapidAPI. When I upload my OpenAPI spec, the web interface shows API names based on the operationId, which is usually in camelCase. This doesn’t look great for users.
For example, if I have an API endpoint like this:
paths:
/users:
get:
summary: Get all users
operationId: getAllUsers
tags:
- users
RapidAPI displays ‘getAllUsers’ in the menu. But I’d prefer something more readable, like ‘Get all users’.
I know other OpenAPI tools use the summary field for this, but RapidAPI doesn’t seem to do that by default.
Is there a way to make RapidAPI show a more user-friendly name without changing the operationId to something non-standard? Maybe there’s a setting or another field I can use to tell RapidAPI to use the summary instead?
I’ve encountered this issue with RapidAPI as well. While there’s no official solution, I’ve found a workaround that might help. You can use the ‘x-rapidapi-display-name’ extension in your OpenAPI spec. It’s not standard, but RapidAPI recognizes it. Here’s how you can modify your spec:
paths:
/users:
get:
summary: Get all users
operationId: getAllUsers
x-rapidapi-display-name: Get all users
tags:
- users
This keeps your operationId intact for code generation purposes while providing a more user-friendly display in the RapidAPI interface. It’s not perfect, but it’s been effective in my projects. Remember, this is a RapidAPI-specific solution and won’t work with other platforms.
I’ve faced a similar issue when working with RapidAPI and OpenAPI specs. Unfortunately, RapidAPI doesn’t provide a built-in way to customize the display names without modifying the operationId.
One workaround I’ve used is to include both the user-friendly name and the camelCase operationId in the summary field, separated by a pipe character. For example:
paths:
/users:
get:
summary: Get all users | getAllUsers
operationId: getAllUsers
tags:
- users
This approach maintains the standard camelCase operationId for code generation purposes while providing a more readable name in the RapidAPI interface. It’s not perfect, but it’s a compromise that has worked well for my team.
Another option is to reach out to RapidAPI support. They might have additional suggestions or be able to implement a feature request for better customization of API naming in their interface.