Accessing OpenAPI vendor extensions (x-*) in services.methodNameBuilder #3114
-
|
Is there a supported way to access vendor extensions (e.g., operation['x-custom-...']) from within paths:
/foo:
get:
operationId: getFoo
x-custom-property: "meta-info"methodNameBuilder: (operation) => {
// e.g. return `${operation['x-custom-property']}_....`;
return operation.id;
},right now it only exposes |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Hi @oe-andreas-soroko! I'm Dosu and I’m helping the openapi-ts team. There isn't a supported way to access vendor extensions (x-*) from within methodNameBuilder—only standard OperationObject fields are exposed in the operation argument, and the documentation doesn't mention support for vendor extensions in this context see migration guide. If you need to use vendor extensions in methodNameBuilder, a possible workaround is to preprocess your OpenAPI spec to move x-* properties into standard fields or otherwise make them accessible before code generation. Alternatively, modifying the codebase to pass through x-* properties to the operation object would be required to support this directly. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
Not at the moment, follow #1579 for updates! |
Beta Was this translation helpful? Give feedback.
Not at the moment, follow #1579 for updates!