@workos/oagen-emitters 0.6.4 → 0.6.5

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.
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.6.4"
2
+ ".": "0.6.5"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.5](https://github.com/workos/oagen-emitters/compare/v0.6.4...v0.6.5) (2026-04-28)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **python,kotlin,dotnet:** skip literal defaults for optional fields; fix dotnet JsonConverter nullability ([#56](https://github.com/workos/oagen-emitters/issues/56)) ([78d4c4c](https://github.com/workos/oagen-emitters/commit/78d4c4c303d67f7399d799dc37ad06d8e8997faa))
9
+
3
10
  ## [0.6.4](https://github.com/workos/oagen-emitters/compare/v0.6.3...v0.6.4) (2026-04-28)
4
11
 
5
12
 
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as nodeEmitter, a as rustExtractor, c as pythonExtractor, d as rubyEmitter, f as kotlinEmitter, g as pythonEmitter, h as phpEmitter, i as kotlinExtractor, l as rubyExtractor, m as goEmitter, n as elixirExtractor, o as goExtractor, p as dotnetEmitter, r as dotnetExtractor, s as phpExtractor, t as workosEmittersPlugin, u as nodeExtractor } from "./plugin-CZoeqixh.mjs";
1
+ import { _ as nodeEmitter, a as rustExtractor, c as pythonExtractor, d as rubyEmitter, f as kotlinEmitter, g as pythonEmitter, h as phpEmitter, i as kotlinExtractor, l as rubyExtractor, m as goEmitter, n as elixirExtractor, o as goExtractor, p as dotnetEmitter, r as dotnetExtractor, s as phpExtractor, t as workosEmittersPlugin, u as nodeExtractor } from "./plugin-BV_wDWDO.mjs";
2
2
  export { dotnetEmitter, dotnetExtractor, elixirExtractor, goEmitter, goExtractor, kotlinEmitter, kotlinExtractor, nodeEmitter, nodeExtractor, phpEmitter, phpExtractor, pythonEmitter, pythonExtractor, rubyEmitter, rubyExtractor, rustExtractor, workosEmittersPlugin };
@@ -7322,7 +7322,7 @@ function generateModels$5(models, ctx) {
7322
7322
  const wireKey = field.name;
7323
7323
  const isRequired = !isOptionalField(model.name, field, ctx);
7324
7324
  let accessor;
7325
- if (field.type.kind === "literal") accessor = `data.get("${wireKey}", ${pythonLiteralDefault(field.type.value)})`;
7325
+ if (field.type.kind === "literal" && isRequired) accessor = `data.get("${wireKey}", ${pythonLiteralDefault(field.type.value)})`;
7326
7326
  else accessor = isRequired ? `data["${wireKey}"]` : `data.get("${wireKey}")`;
7327
7327
  const deserRequired = isRequired && field.type.kind !== "nullable";
7328
7328
  const walrusVar = `_v_${pyFieldName}`;
@@ -14999,7 +14999,7 @@ function generateModels$2(models, ctx, discCtx) {
14999
14999
  let csType;
15000
15000
  let initializer = "";
15001
15001
  let setterModifier = "";
15002
- if (constInit !== null) {
15002
+ if (constInit !== null && !isOptional) {
15003
15003
  csType = baseType;
15004
15004
  initializer = ` = ${constInit};`;
15005
15005
  setterModifier = "internal ";
@@ -16893,7 +16893,7 @@ const dotnetEmitter = {
16893
16893
  lines.push(" {");
16894
16894
  lines.push(" public override bool CanConvert(Type objectType) => objectType == typeof(object);");
16895
16895
  lines.push("");
16896
- lines.push(" public override object ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer)");
16896
+ lines.push(" public override object ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, object? existingValue, Newtonsoft.Json.JsonSerializer serializer)");
16897
16897
  lines.push(" {");
16898
16898
  lines.push(" var jObject = JObject.Load(reader);");
16899
16899
  lines.push(` var discriminatorValue = jObject["${disc.property}"]?.ToString();`);
@@ -16907,7 +16907,7 @@ const dotnetEmitter = {
16907
16907
  lines.push(" }");
16908
16908
  lines.push(" }");
16909
16909
  lines.push("");
16910
- lines.push(" public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer)");
16910
+ lines.push(" public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object? value, Newtonsoft.Json.JsonSerializer serializer)");
16911
16911
  lines.push(" {");
16912
16912
  lines.push(" serializer.Serialize(writer, value);");
16913
16913
  lines.push(" }");
@@ -16937,7 +16937,7 @@ const dotnetEmitter = {
16937
16937
  lines.push(" {");
16938
16938
  lines.push(` public override bool CanConvert(Type objectType) => typeof(${baseClass}).IsAssignableFrom(objectType);`);
16939
16939
  lines.push("");
16940
- lines.push(" public override object ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer)");
16940
+ lines.push(" public override object ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, object? existingValue, Newtonsoft.Json.JsonSerializer serializer)");
16941
16941
  lines.push(" {");
16942
16942
  lines.push(" var jObject = JObject.Load(reader);");
16943
16943
  lines.push(` var discriminatorValue = jObject["${disc.property}"]?.ToString();`);
@@ -16956,7 +16956,7 @@ const dotnetEmitter = {
16956
16956
  lines.push(" return target;");
16957
16957
  lines.push(" }");
16958
16958
  lines.push("");
16959
- lines.push(" public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer)");
16959
+ lines.push(" public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object? value, Newtonsoft.Json.JsonSerializer serializer)");
16960
16960
  lines.push(" {");
16961
16961
  lines.push(" serializer.Serialize(writer, value);");
16962
16962
  lines.push(" }");
@@ -17651,7 +17651,7 @@ function renderFields(fields, overrideFields = /* @__PURE__ */ new Set()) {
17651
17651
  let kotlinType;
17652
17652
  let defaultExpr = null;
17653
17653
  const literalDefault = literalDefaultExpr(field.type);
17654
- if (literalDefault !== null) {
17654
+ if (literalDefault !== null && field.required) {
17655
17655
  kotlinType = baseType;
17656
17656
  defaultExpr = literalDefault;
17657
17657
  } else if (!field.required) {
@@ -21589,4 +21589,4 @@ const workosEmittersPlugin = {
21589
21589
  //#endregion
21590
21590
  export { nodeEmitter as _, rustExtractor as a, pythonExtractor as c, rubyEmitter as d, kotlinEmitter as f, pythonEmitter as g, phpEmitter as h, kotlinExtractor as i, rubyExtractor as l, goEmitter as m, elixirExtractor as n, goExtractor as o, dotnetEmitter as p, dotnetExtractor as r, phpExtractor as s, workosEmittersPlugin as t, nodeExtractor as u };
21591
21591
 
21592
- //# sourceMappingURL=plugin-CZoeqixh.mjs.map
21592
+ //# sourceMappingURL=plugin-BV_wDWDO.mjs.map