@workos/oagen 0.17.3 → 0.18.0

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.
@@ -886,13 +886,16 @@ function deriveInlineVariantMapping(variants, discriminatorProperty, contextName
886
886
  return mapping;
887
887
  }
888
888
  function extractEnum(name, schema) {
889
+ const values = (schema.enum ?? []).map((v) => ({
890
+ name: toUpperSnakeCase(String(v)),
891
+ value: typeof v === "number" ? v : String(v),
892
+ description: void 0
893
+ }));
894
+ const rawDefault = schema.default;
889
895
  return {
890
896
  name,
891
- values: (schema.enum ?? []).map((v) => ({
892
- name: toUpperSnakeCase(String(v)),
893
- value: typeof v === "number" ? v : String(v),
894
- description: void 0
895
- }))
897
+ values,
898
+ default: rawDefault !== void 0 && values.some((v) => v.value === rawDefault) ? rawDefault : void 0
896
899
  };
897
900
  }
898
901
  function extractModel(name, schema, schemas) {