···263263 if (nonVoidResponses.length > 1) {
264264 if (config.debug) {
265265 console.warn(
266266- `⚠️ Transformers warning: route ${operation.method} ${operation.path} has ${nonVoidResponses.length} non-void success responses. This is currently not handled and we will not generate a response transformer. Please open an issue if you'd like this feature https://github.com/hey-api/openapi-ts/issues`,
266266+ `❗️ Transformers warning: route ${operation.method} ${operation.path} has ${nonVoidResponses.length} non-void success responses. This is currently not handled and we will not generate a response transformer. Please open an issue if you'd like this feature https://github.com/hey-api/openapi-ts/issues`,
267267 );
268268 }
269269 continue;
+1-1
packages/openapi-ts/src/index.ts
···262262263263 if (!useOptions) {
264264 console.warn(
265265- '⚠️ Deprecation warning: useOptions set to false. This setting will be removed in future versions. Please migrate useOptions to true https://heyapi.vercel.app/openapi-ts/migrating.html#v0-27-38',
265265+ '❗️ Deprecation warning: useOptions set to false. This setting will be removed in future versions. Please migrate useOptions to true https://heyapi.vercel.app/openapi-ts/migrating.html#v0-27-38',
266266 );
267267 }
268268
···1616}: {
1717 openApi: OpenApi;
1818 types: Client['types'];
1919-}): Service[] => {
1919+}): Pick<Client, 'operationIds' | 'services'> => {
2020 const config = getConfig();
21212222 const regexp = config.services.filter
2323 ? new RegExp(config.services.filter)
2424 : undefined;
25252626+ const operationIds = new Map<string, string>();
2627 const services = new Map<string, Service>();
27282829 for (const url in openApi.paths) {
···3637 for (const key in path) {
3738 const method = key as Lowercase<Operation['method']>;
38393939- const shouldProcess =
4040- !regexp || regexp.test(`${method.toUpperCase()} ${url}`);
4040+ const operationKey = `${method.toUpperCase()} ${url}`;
4141+ const shouldProcess = !regexp || regexp.test(operationKey);
41424243 if (shouldProcess && allowedServiceMethods.includes(method)) {
4344 const op = path[method]!;
4545+4646+ if (op.operationId) {
4747+ if (operationIds.has(op.operationId)) {
4848+ console.warn(
4949+ `❗️ Duplicate operationId: ${op.operationId} in ${operationKey}. Please ensure your operation IDs are unique. This behavior is not supported and will likely lead to unexpected results.`,
5050+ );
5151+ } else {
5252+ operationIds.set(op.operationId, operationKey);
5353+ }
5454+ }
5555+4456 const tags =
4557 op.tags?.length && (config.services.asClass || config.name)
4658 ? op.tags.filter(unique)
···6678 }
6779 }
68806969- return Array.from(services.values());
8181+ return {
8282+ operationIds,
8383+ services: Array.from(services.values()),
8484+ };
7085};
+6
packages/openapi-ts/src/types/client.ts
···3344export interface Client {
55 models: Model[];
66+ /**
77+ * Map of unique operation IDs where operation IDs are keys. The values
88+ * are endpoints in the `${method} ${path}` format. This is used to detect
99+ * duplicate operation IDs in the specification.
1010+ */
1111+ operationIds: Map<string, string>;
612 server: string;
713 services: Service[];
814 /**