@workos/oagen 0.25.0 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2534,13 +2534,14 @@ function flattenDiscriminatedUnionBody(schema) {
2534
2534
  /** Derive a unique variant name for a oneOf inline model. */
2535
2535
  function deriveOneOfVariantName(variant, baseName, existingModels) {
2536
2536
  if (variant.properties) {
2537
- for (const [, propSchema] of Object.entries(variant.properties)) if (propSchema?.const && typeof propSchema.const === "string") return toPascalCase(propSchema.const) + baseName.replace(/Request$/, "") + "Request";
2537
+ for (const [, propSchema] of Object.entries(variant.properties)) if (propSchema?.const && typeof propSchema.const === "string") return resolveSchemaName(toPascalCase(propSchema.const) + baseName.replace(/Request$/, "") + "Request");
2538
2538
  }
2539
2539
  const existingNames = new Set(existingModels.map((m) => m.name));
2540
- let name = baseName;
2540
+ const transformedBaseName = resolveSchemaName(baseName);
2541
+ let name = transformedBaseName;
2541
2542
  let suffix = 2;
2542
2543
  while (existingNames.has(name)) {
2543
- name = `${baseName}${suffix}`;
2544
+ name = `${transformedBaseName}${suffix}`;
2544
2545
  suffix++;
2545
2546
  }
2546
2547
  return name;