@workos/oagen 0.24.6 → 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.
@@ -2461,13 +2461,14 @@ function flattenDiscriminatedUnionBody(schema) {
2461
2461
  /** Derive a unique variant name for a oneOf inline model. */
2462
2462
  function deriveOneOfVariantName(variant, baseName, existingModels) {
2463
2463
  if (variant.properties) {
2464
- for (const [, propSchema] of Object.entries(variant.properties)) if (propSchema?.const && typeof propSchema.const === "string") return toPascalCase(propSchema.const) + baseName.replace(/Request$/, "") + "Request";
2464
+ for (const [, propSchema] of Object.entries(variant.properties)) if (propSchema?.const && typeof propSchema.const === "string") return resolveSchemaName(toPascalCase(propSchema.const) + baseName.replace(/Request$/, "") + "Request");
2465
2465
  }
2466
2466
  const existingNames = new Set(existingModels.map((m) => m.name));
2467
- let name = baseName;
2467
+ const transformedBaseName = resolveSchemaName(baseName);
2468
+ let name = transformedBaseName;
2468
2469
  let suffix = 2;
2469
2470
  while (existingNames.has(name)) {
2470
- name = `${baseName}${suffix}`;
2471
+ name = `${transformedBaseName}${suffix}`;
2471
2472
  suffix++;
2472
2473
  }
2473
2474
  return name;