@workos/oagen 0.22.6 → 0.22.7

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.
@@ -2643,6 +2643,7 @@ async function parseSpec(specPath, options) {
2643
2643
  const fieldInlineModels = extractInlineModelsFromSchemas(spec.components?.schemas);
2644
2644
  clearSchemaNameTransform();
2645
2645
  const finalModels = collapseJsonSuffixModels(mergeFieldInlineModels(responseNormalizedModels, fieldInlineModels), services);
2646
+ applyFieldHints(finalModels, options?.fieldHints);
2646
2647
  collectInlineEnumsFromModels(finalModels, enums);
2647
2648
  collectInlineEnumsFromOperations(services, enums);
2648
2649
  const auth = extractAuthSchemes(spec.components?.securitySchemes);
@@ -2665,6 +2666,22 @@ async function parseSpec(specPath, options) {
2665
2666
  validateModelRefs(result);
2666
2667
  return result;
2667
2668
  }
2669
+ /**
2670
+ * Apply `fieldHints` onto the built models, setting `Field.domainName` for each
2671
+ * matching (model name, wire field name) pair. Serialization still uses
2672
+ * `Field.name`; only the domain-facing identifier changes.
2673
+ */
2674
+ function applyFieldHints(models, fieldHints) {
2675
+ if (!fieldHints) return;
2676
+ for (const model of models) {
2677
+ const hints = fieldHints[model.name];
2678
+ if (!hints) continue;
2679
+ for (const field of model.fields) {
2680
+ const domainName = hints[field.name];
2681
+ if (domainName) field.domainName = domainName;
2682
+ }
2683
+ }
2684
+ }
2668
2685
  /** Extract authentication schemes from OpenAPI securitySchemes. */
2669
2686
  function extractAuthSchemes(securitySchemes) {
2670
2687
  if (!securitySchemes) return void 0;