Turns OpenAPI names into Elixir module and function names.
Each operation gets a module path (["Repos"], ["ZeroTrust", "Devices"])
and a function name, from the first strategy that applies:
- Vendor SDK hints:
x-fern-sdk-group-name(dot-separated groups) andx-fern-sdk-method-name. Cloudflare sets them on nearly every operation, so its SDK matches the official ones. group/actionoperation IDs, as GitHub uses (repos/get).- The path, when the operation has no tag (all of Stripe, part of
OpenAI):
GET /v1/customersisCustomers.list,POST /v1/customers/{id}isCustomers.update,POST /v1/payment_intents/{id}/cancelisPaymentIntents.cancel, and/v1/customers/{id}/sourcesis a nestedCustomers.Sources. - The tag and the operation ID, with version prefixes taken off the
tag (Twilio's
Api20100401Recording) and the module's words taken off the function (list_recordinginRecordingislist).
Summary
Functions
A function or field name: "createChatCompletion", "repos/get-pages" -> snake_case.
A module name part: "vector stores", "vector_stores", "vector-stores" -> "VectorStores".
Names an operation. op is the operation object, path and method its location.
The package name for a base module, as the vendor writes it: OpenAI is
openai, GitHub is github (not open_ai, git_hub). Used for the
app, the directory and the API key's environment variable.
Splits camelCase, PascalCase, kebab, snake, dotted and spaced names into lowercase words.
Types
Functions
A function or field name: "createChatCompletion", "repos/get-pages" -> snake_case.
A module name part: "vector stores", "vector_stores", "vector-stores" -> "VectorStores".
@spec operation(map(), String.t(), String.t()) :: operation_name()
Names an operation. op is the operation object, path and method its location.
The package name for a base module, as the vendor writes it: OpenAI is
openai, GitHub is github (not open_ai, git_hub). Used for the
app, the directory and the API key's environment variable.
Splits camelCase, PascalCase, kebab, snake, dotted and spaced names into lowercase words.