···1515] as const;
16161717/**
1818- * Verifies that operation ID is unique. For now, we only warn when this isn't
1919- * true as people like to not follow this part of the specification. In the
2020- * future, we should add a strict check and throw on duplicate identifiers.
2121- */
2222-export const ensureUniqueOperationId = ({
2323- context,
2424- id,
2525- method,
2626- operationIds,
2727- path,
2828-}: {
2929- context: IR.Context;
3030- id: string | undefined;
3131- method: IR.OperationObject['method'];
3232- operationIds: Map<string, string>;
3333- path: keyof IR.PathsObject;
3434-}) => {
3535- if (!id) {
3636- return;
3737- }
3838-3939- const operationKey = `${method.toUpperCase()} ${path}`;
4040-4141- if (operationIds.has(id)) {
4242- if (context.config.logs.level !== 'silent') {
4343- // TODO: parser - support throw on duplicate
4444- console.warn(
4545- `❗️ Duplicate operationId: ${id} in ${operationKey}. Please ensure your operation IDs are unique. This behavior is not supported and will likely lead to unexpected results.`,
4646- );
4747- }
4848- } else {
4949- operationIds.set(id, operationKey);
5050- }
5151-};
5252-5353-/**
5418 * Returns an operation ID to use across the application. By default, we try
5519 * to use the provided ID. If it's not provided or the SDK is configured
5620 * to exclude it, we generate operation ID from its location.
···9191 * **This is an experimental feature.**
9292 *
9393 * Validate the input before generating output? This is an experimental,
9494- * lightweight feature and support will be added on an ad hoc basis.
9494+ * lightweight feature and support will be added on an ad hoc basis. Setting
9595+ * `validate_EXPERIMENTAL` to `true` is the same as `warn`.
9596 *
9697 * @default false
9798 */
9898- validate_EXPERIMENTAL?: boolean;
9999+ validate_EXPERIMENTAL?: boolean | 'strict' | 'warn';
99100 /**
100101 * **Requires `path` to start with `https://get.heyapi.dev` or be undefined**
101102 *