@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.
@@ -937,13 +937,16 @@ function deriveInlineVariantMapping(variants, discriminatorProperty, contextName
937
937
  return mapping;
938
938
  }
939
939
  function extractEnum(name, schema) {
940
+ const values = (schema.enum ?? []).map((v) => ({
941
+ name: toUpperSnakeCase(String(v)),
942
+ value: typeof v === "number" ? v : String(v),
943
+ description: void 0
944
+ }));
945
+ const rawDefault = schema.default;
940
946
  return {
941
947
  name,
942
- values: (schema.enum ?? []).map((v) => ({
943
- name: toUpperSnakeCase(String(v)),
944
- value: typeof v === "number" ? v : String(v),
945
- description: void 0
946
- }))
948
+ values,
949
+ default: rawDefault !== void 0 && values.some((v) => v.value === rawDefault) ? rawDefault : void 0
947
950
  };
948
951
  }
949
952
  function extractModel(name, schema, schemas) {