diff --git a/head/schema-cplusplus/test/inputs/schema/issue-1833/default/quicktype.hpp b/head/schema-cplusplus/test/inputs/schema/issue-1833/default/quicktype.hpp
new file mode 100644
index 0000000..4986ce3
--- /dev/null
+++ b/head/schema-cplusplus/test/inputs/schema/issue-1833/default/quicktype.hpp
@@ -0,0 +1,163 @@
+//  To parse this JSON data, first install
+//
+//      json.hpp  https://github.com/nlohmann/json
+//
+//  Then include this file, and then do
+//
+//     A data = nlohmann::json::parse(jsonString);
+//     B data = nlohmann::json::parse(jsonString);
+//     C data = nlohmann::json::parse(jsonString);
+//     TopLevel data = nlohmann::json::parse(jsonString);
+
+#pragma once
+
+#include "json.hpp"
+
+#include <optional>
+#include <stdexcept>
+#include <regex>
+
+namespace quicktype {
+    using nlohmann::json;
+
+    #ifndef NLOHMANN_UNTYPED_quicktype_HELPER
+    #define NLOHMANN_UNTYPED_quicktype_HELPER
+    inline json get_untyped(const json & j, const char * property) {
+        if (j.find(property) != j.end()) {
+            return j.at(property).get<json>();
+        }
+        return json();
+    }
+
+    inline json get_untyped(const json & j, std::string property) {
+        return get_untyped(j, property.data());
+    }
+    #endif
+
+    class C {
+        public:
+        C() = default;
+        virtual ~C() = default;
+
+        private:
+        std::string name;
+
+        public:
+        const std::string & get_name() const { return name; }
+        std::string & get_mutable_name() { return name; }
+        void set_name(const std::string & value) { this->name = value; }
+    };
+
+    class A {
+        public:
+        A() = default;
+        virtual ~A() = default;
+
+        private:
+        std::vector<C> in;
+        std::string name;
+
+        public:
+        const std::vector<C> & get_in() const { return in; }
+        std::vector<C> & get_mutable_in() { return in; }
+        void set_in(const std::vector<C> & value) { this->in = value; }
+
+        const std::string & get_name() const { return name; }
+        std::string & get_mutable_name() { return name; }
+        void set_name(const std::string & value) { this->name = value; }
+    };
+
+    class B {
+        public:
+        B() = default;
+        virtual ~B() = default;
+
+        private:
+        std::string name;
+        std::vector<C> out;
+
+        public:
+        const std::string & get_name() const { return name; }
+        std::string & get_mutable_name() { return name; }
+        void set_name(const std::string & value) { this->name = value; }
+
+        const std::vector<C> & get_out() const { return out; }
+        std::vector<C> & get_mutable_out() { return out; }
+        void set_out(const std::vector<C> & value) { this->out = value; }
+    };
+
+    class TopLevel {
+        public:
+        TopLevel() = default;
+        virtual ~TopLevel() = default;
+
+        private:
+        A a;
+        B b;
+
+        public:
+        const A & get_a() const { return a; }
+        A & get_mutable_a() { return a; }
+        void set_a(const A & value) { this->a = value; }
+
+        const B & get_b() const { return b; }
+        B & get_mutable_b() { return b; }
+        void set_b(const B & value) { this->b = value; }
+    };
+}
+
+namespace quicktype {
+    void from_json(const json & j, C & x);
+    void to_json(json & j, const C & x);
+
+    void from_json(const json & j, A & x);
+    void to_json(json & j, const A & x);
+
+    void from_json(const json & j, B & x);
+    void to_json(json & j, const B & x);
+
+    void from_json(const json & j, TopLevel & x);
+    void to_json(json & j, const TopLevel & x);
+
+    inline void from_json(const json & j, C& x) {
+        x.set_name(j.at("name").get<std::string>());
+    }
+
+    inline void to_json(json & j, const C & x) {
+        j = json::object();
+        j["name"] = x.get_name();
+    }
+
+    inline void from_json(const json & j, A& x) {
+        x.set_in(j.at("in").get<std::vector<C>>());
+        x.set_name(j.at("name").get<std::string>());
+    }
+
+    inline void to_json(json & j, const A & x) {
+        j = json::object();
+        j["in"] = x.get_in();
+        j["name"] = x.get_name();
+    }
+
+    inline void from_json(const json & j, B& x) {
+        x.set_name(j.at("name").get<std::string>());
+        x.set_out(j.at("out").get<std::vector<C>>());
+    }
+
+    inline void to_json(json & j, const B & x) {
+        j = json::object();
+        j["name"] = x.get_name();
+        j["out"] = x.get_out();
+    }
+
+    inline void from_json(const json & j, TopLevel& x) {
+        x.set_a(j.at("a").get<A>());
+        x.set_b(j.at("b").get<B>());
+    }
+
+    inline void to_json(json & j, const TopLevel & x) {
+        j = json::object();
+        j["a"] = x.get_a();
+        j["b"] = x.get_b();
+    }
+}
diff --git a/head/schema-csharp/test/inputs/schema/issue-1833/default/QuickType.cs b/head/schema-csharp/test/inputs/schema/issue-1833/default/QuickType.cs
new file mode 100644
index 0000000..f623021
--- /dev/null
+++ b/head/schema-csharp/test/inputs/schema/issue-1833/default/QuickType.cs
@@ -0,0 +1,109 @@
+// <auto-generated />
+//
+// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do one of these:
+//
+//    using QuickType;
+//
+//    var a = A.FromJson(jsonString);
+//    var b = B.FromJson(jsonString);
+//    var c = C.FromJson(jsonString);
+//    var topLevel = TopLevel.FromJson(jsonString);
+#nullable enable
+#pragma warning disable CS8618
+#pragma warning disable CS8601
+#pragma warning disable CS8602
+#pragma warning disable CS8603
+#pragma warning disable CS8604
+#pragma warning disable CS8625
+#pragma warning disable CS8765
+
+namespace QuickType
+{
+    using System;
+    using System.Collections.Generic;
+
+    using System.Globalization;
+    using Newtonsoft.Json;
+    using Newtonsoft.Json.Converters;
+
+    public partial class TopLevel
+    {
+        [JsonProperty("a", Required = Required.Always)]
+        public A A { get; set; }
+
+        [JsonProperty("b", Required = Required.Always)]
+        public B B { get; set; }
+    }
+
+    public partial class A
+    {
+        [JsonProperty("in", Required = Required.Always)]
+        public C[] In { get; set; }
+
+        [JsonProperty("name", Required = Required.Always)]
+        public string Name { get; set; }
+    }
+
+    public partial class C
+    {
+        [JsonProperty("name", Required = Required.Always)]
+        public string Name { get; set; }
+    }
+
+    public partial class B
+    {
+        [JsonProperty("name", Required = Required.Always)]
+        public string Name { get; set; }
+
+        [JsonProperty("out", Required = Required.Always)]
+        public C[] Out { get; set; }
+    }
+
+    public partial class A
+    {
+        public static A FromJson(string json) => JsonConvert.DeserializeObject<A>(json, QuickType.Converter.Settings);
+    }
+
+    public partial class B
+    {
+        public static B FromJson(string json) => JsonConvert.DeserializeObject<B>(json, QuickType.Converter.Settings);
+    }
+
+    public partial class C
+    {
+        public static C FromJson(string json) => JsonConvert.DeserializeObject<C>(json, QuickType.Converter.Settings);
+    }
+
+    public partial class TopLevel
+    {
+        public static TopLevel FromJson(string json) => JsonConvert.DeserializeObject<TopLevel>(json, QuickType.Converter.Settings);
+    }
+
+    public static partial class Serialize
+    {
+        public static string ToJson(this A self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
+        public static string ToJson(this B self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
+        public static string ToJson(this C self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
+        public static string ToJson(this TopLevel self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
+    }
+
+    internal static partial class Converter
+    {
+        public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
+        {
+            MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
+            DateParseHandling = DateParseHandling.None,
+            Converters =
+            {
+                new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
+            },
+        };
+    }
+}
+#pragma warning restore CS8618
+#pragma warning restore CS8601
+#pragma warning restore CS8602
+#pragma warning restore CS8603
+#pragma warning restore CS8604
+#pragma warning restore CS8625
+#pragma warning restore CS8765
diff --git a/head/schema-csharp-SystemTextJson/test/inputs/schema/issue-1833/default/QuickType.cs b/head/schema-csharp-SystemTextJson/test/inputs/schema/issue-1833/default/QuickType.cs
new file mode 100644
index 0000000..8614396
--- /dev/null
+++ b/head/schema-csharp-SystemTextJson/test/inputs/schema/issue-1833/default/QuickType.cs
@@ -0,0 +1,220 @@
+// <auto-generated />
+//
+// To parse this JSON data, add NuGet 'System.Text.Json' then do one of these:
+//
+//    using QuickType;
+//
+//    var a = A.FromJson(jsonString);
+//    var b = B.FromJson(jsonString);
+//    var c = C.FromJson(jsonString);
+//    var topLevel = TopLevel.FromJson(jsonString);
+#nullable enable
+#pragma warning disable CS8618
+#pragma warning disable CS8601
+#pragma warning disable CS8602
+#pragma warning disable CS8603
+
+namespace QuickType
+{
+    using System;
+    using System.Collections.Generic;
+
+    using System.Text.Json;
+    using System.Text.Json.Serialization;
+    using System.Globalization;
+
+    public partial class TopLevel
+    {
+        [JsonRequired]
+        [JsonPropertyName("a")]
+        public A A { get; set; }
+
+        [JsonRequired]
+        [JsonPropertyName("b")]
+        public B B { get; set; }
+    }
+
+    public partial class A
+    {
+        [JsonRequired]
+        [JsonPropertyName("in")]
+        public C[] In { get; set; }
+
+        [JsonRequired]
+        [JsonPropertyName("name")]
+        public string Name { get; set; }
+    }
+
+    public partial class C
+    {
+        [JsonRequired]
+        [JsonPropertyName("name")]
+        public string Name { get; set; }
+    }
+
+    public partial class B
+    {
+        [JsonRequired]
+        [JsonPropertyName("name")]
+        public string Name { get; set; }
+
+        [JsonRequired]
+        [JsonPropertyName("out")]
+        public C[] Out { get; set; }
+    }
+
+    public partial class A
+    {
+        public static A FromJson(string json) => JsonSerializer.Deserialize<A>(json, QuickType.Converter.Settings);
+    }
+
+    public partial class B
+    {
+        public static B FromJson(string json) => JsonSerializer.Deserialize<B>(json, QuickType.Converter.Settings);
+    }
+
+    public partial class C
+    {
+        public static C FromJson(string json) => JsonSerializer.Deserialize<C>(json, QuickType.Converter.Settings);
+    }
+
+    public partial class TopLevel
+    {
+        public static TopLevel FromJson(string json) => JsonSerializer.Deserialize<TopLevel>(json, QuickType.Converter.Settings);
+    }
+
+    public static partial class Serialize
+    {
+        public static string ToJson(this A self) => JsonSerializer.Serialize(self, QuickType.Converter.Settings);
+        public static string ToJson(this B self) => JsonSerializer.Serialize(self, QuickType.Converter.Settings);
+        public static string ToJson(this C self) => JsonSerializer.Serialize(self, QuickType.Converter.Settings);
+        public static string ToJson(this TopLevel self) => JsonSerializer.Serialize(self, QuickType.Converter.Settings);
+    }
+
+    internal static partial class Converter
+    {
+        public static readonly JsonSerializerOptions Settings = new(JsonSerializerDefaults.General)
+        {
+            Converters =
+            {
+                new DateOnlyConverter(),
+                new TimeOnlyConverter(),
+                IsoDateTimeOffsetConverter.Singleton
+            },
+        };
+    }
+    
+    public class DateOnlyConverter : JsonConverter<DateOnly>
+    {
+        private readonly string serializationFormat;
+        public DateOnlyConverter() : this(null) { }
+
+        public DateOnlyConverter(string? serializationFormat)
+        {
+                this.serializationFormat = serializationFormat ?? "yyyy-MM-dd";
+        }
+
+        public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+        {
+                var value = reader.GetString();
+                return DateOnly.Parse(value!);
+        }
+
+        public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)
+                => writer.WriteStringValue(value.ToString(serializationFormat));
+    }
+
+    public class TimeOnlyConverter : JsonConverter<TimeOnly>
+    {
+        private readonly string serializationFormat;
+
+        public TimeOnlyConverter() : this(null) { }
+
+        public TimeOnlyConverter(string? serializationFormat)
+        {
+                this.serializationFormat = serializationFormat ?? "HH:mm:ss.fff";
+        }
+
+        public override TimeOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+        {
+                var value = reader.GetString();
+                return TimeOnly.Parse(value!);
+        }
+
+        public override void Write(Utf8JsonWriter writer, TimeOnly value, JsonSerializerOptions options)
+                => writer.WriteStringValue(value.ToString(serializationFormat));
+    }
+
+    internal class IsoDateTimeOffsetConverter : JsonConverter<DateTimeOffset>
+    {
+        public override bool CanConvert(Type t) => t == typeof(DateTimeOffset);
+
+        private const string DefaultDateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";
+
+        private DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind;
+        private string? _dateTimeFormat;
+        private CultureInfo? _culture;
+
+        public DateTimeStyles DateTimeStyles
+        {
+                get => _dateTimeStyles;
+                set => _dateTimeStyles = value;
+        }
+
+        public string? DateTimeFormat
+        {
+                get => _dateTimeFormat ?? string.Empty;
+                set => _dateTimeFormat = (string.IsNullOrEmpty(value)) ? null : value;
+        }
+
+        public CultureInfo Culture
+        {
+                get => _culture ?? CultureInfo.CurrentCulture;
+                set => _culture = value;
+        }
+
+        public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options)
+        {
+                string text;
+
+
+                if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal
+                        || (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal)
+                {
+                        value = value.ToUniversalTime();
+                }
+
+                text = value.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture);
+
+                writer.WriteStringValue(text);
+        }
+
+        public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+        {
+                string? dateText = reader.GetString();
+
+                if (string.IsNullOrEmpty(dateText) == false)
+                {
+                        if (!string.IsNullOrEmpty(_dateTimeFormat))
+                        {
+                                return DateTimeOffset.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles);
+                        }
+                        else
+                        {
+                                return DateTimeOffset.Parse(dateText, Culture, _dateTimeStyles);
+                        }
+                }
+                else
+                {
+                        return default(DateTimeOffset);
+                }
+        }
+
+
+        public static readonly IsoDateTimeOffsetConverter Singleton = new IsoDateTimeOffsetConverter();
+    }
+}
+#pragma warning restore CS8618
+#pragma warning restore CS8601
+#pragma warning restore CS8602
+#pragma warning restore CS8603
diff --git a/head/schema-csharp-records/test/inputs/schema/issue-1833/default/QuickType.cs b/head/schema-csharp-records/test/inputs/schema/issue-1833/default/QuickType.cs
new file mode 100644
index 0000000..9bf027a
--- /dev/null
+++ b/head/schema-csharp-records/test/inputs/schema/issue-1833/default/QuickType.cs
@@ -0,0 +1,109 @@
+// <auto-generated />
+//
+// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do one of these:
+//
+//    using QuickType;
+//
+//    var a = A.FromJson(jsonString);
+//    var b = B.FromJson(jsonString);
+//    var c = C.FromJson(jsonString);
+//    var topLevel = TopLevel.FromJson(jsonString);
+#nullable enable
+#pragma warning disable CS8618
+#pragma warning disable CS8601
+#pragma warning disable CS8602
+#pragma warning disable CS8603
+#pragma warning disable CS8604
+#pragma warning disable CS8625
+#pragma warning disable CS8765
+
+namespace QuickType
+{
+    using System;
+    using System.Collections.Generic;
+
+    using System.Globalization;
+    using Newtonsoft.Json;
+    using Newtonsoft.Json.Converters;
+
+    public partial record TopLevel
+    {
+        [JsonProperty("a", Required = Required.Always)]
+        public A A { get; set; }
+
+        [JsonProperty("b", Required = Required.Always)]
+        public B B { get; set; }
+    }
+
+    public partial record A
+    {
+        [JsonProperty("in", Required = Required.Always)]
+        public C[] In { get; set; }
+
+        [JsonProperty("name", Required = Required.Always)]
+        public string Name { get; set; }
+    }
+
+    public partial record C
+    {
+        [JsonProperty("name", Required = Required.Always)]
+        public string Name { get; set; }
+    }
+
+    public partial record B
+    {
+        [JsonProperty("name", Required = Required.Always)]
+        public string Name { get; set; }
+
+        [JsonProperty("out", Required = Required.Always)]
+        public C[] Out { get; set; }
+    }
+
+    public partial record A
+    {
+        public static A FromJson(string json) => JsonConvert.DeserializeObject<A>(json, QuickType.Converter.Settings);
+    }
+
+    public partial record B
+    {
+        public static B FromJson(string json) => JsonConvert.DeserializeObject<B>(json, QuickType.Converter.Settings);
+    }
+
+    public partial record C
+    {
+        public static C FromJson(string json) => JsonConvert.DeserializeObject<C>(json, QuickType.Converter.Settings);
+    }
+
+    public partial record TopLevel
+    {
+        public static TopLevel FromJson(string json) => JsonConvert.DeserializeObject<TopLevel>(json, QuickType.Converter.Settings);
+    }
+
+    public static partial class Serialize
+    {
+        public static string ToJson(this A self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
+        public static string ToJson(this B self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
+        public static string ToJson(this C self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
+        public static string ToJson(this TopLevel self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
+    }
+
+    internal static partial class Converter
+    {
+        public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
+        {
+            MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
+            DateParseHandling = DateParseHandling.None,
+            Converters =
+            {
+                new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
+            },
+        };
+    }
+}
+#pragma warning restore CS8618
+#pragma warning restore CS8601
+#pragma warning restore CS8602
+#pragma warning restore CS8603
+#pragma warning restore CS8604
+#pragma warning restore CS8625
+#pragma warning restore CS8765
diff --git a/head/schema-dart/test/inputs/schema/issue-1833/default/TopLevel.dart b/head/schema-dart/test/inputs/schema/issue-1833/default/TopLevel.dart
new file mode 100644
index 0000000..24c18a5
--- /dev/null
+++ b/head/schema-dart/test/inputs/schema/issue-1833/default/TopLevel.dart
@@ -0,0 +1,100 @@
+// To parse this JSON data, do
+//
+//     final a = aFromJson(jsonString);
+//     final b = bFromJson(jsonString);
+//     final c = cFromJson(jsonString);
+//     final topLevel = topLevelFromJson(jsonString);
+
+import 'dart:convert';
+
+A aFromJson(String str) => A.fromJson(json.decode(str));
+
+String aToJson(A data) => json.encode(data.toJson());
+
+B bFromJson(String str) => B.fromJson(json.decode(str));
+
+String bToJson(B data) => json.encode(data.toJson());
+
+C cFromJson(String str) => C.fromJson(json.decode(str));
+
+String cToJson(C data) => json.encode(data.toJson());
+
+TopLevel topLevelFromJson(String str) => TopLevel.fromJson(json.decode(str));
+
+String topLevelToJson(TopLevel data) => json.encode(data.toJson());
+
+class TopLevel {
+    final A a;
+    final B b;
+
+    TopLevel({
+        required this.a,
+        required this.b,
+    });
+
+    factory TopLevel.fromJson(Map<String, dynamic> json) => TopLevel(
+        a: A.fromJson(json["a"]),
+        b: B.fromJson(json["b"]),
+    );
+
+    Map<String, dynamic> toJson() => {
+        "a": a.toJson(),
+        "b": b.toJson(),
+    };
+}
+
+class A {
+    final List<C> aIn;
+    final String name;
+
+    A({
+        required this.aIn,
+        required this.name,
+    });
+
+    factory A.fromJson(Map<String, dynamic> json) => A(
+        aIn: List<C>.from(json["in"].map((x) => C.fromJson(x))),
+        name: json["name"],
+    );
+
+    Map<String, dynamic> toJson() => {
+        "in": List<dynamic>.from(aIn.map((x) => x.toJson())),
+        "name": name,
+    };
+}
+
+class C {
+    final String name;
+
+    C({
+        required this.name,
+    });
+
+    factory C.fromJson(Map<String, dynamic> json) => C(
+        name: json["name"],
+    );
+
+    Map<String, dynamic> toJson() => {
+        "name": name,
+    };
+}
+
+class B {
+    final String name;
+    final List<C> out;
+
+    B({
+        required this.name,
+        required this.out,
+    });
+
+    factory B.fromJson(Map<String, dynamic> json) => B(
+        name: json["name"],
+        out: List<C>.from(json["out"].map((x) => C.fromJson(x))),
+    );
+
+    Map<String, dynamic> toJson() => {
+        "name": name,
+        "out": List<dynamic>.from(out.map((x) => x.toJson())),
+    };
+}
diff --git a/head/schema-flow/test/inputs/schema/issue-1833/default/TopLevel.js b/head/schema-flow/test/inputs/schema/issue-1833/default/TopLevel.js
new file mode 100644
index 0000000..df65038
--- /dev/null
+++ b/head/schema-flow/test/inputs/schema/issue-1833/default/TopLevel.js
@@ -0,0 +1,252 @@
+// @flow
+
+// To parse this data:
+//
+//   const Convert = require("./TopLevel");
+//
+//   const a = Convert.toA(json);
+//   const b = Convert.toB(json);
+//   const c = Convert.toC(json);
+//   const topLevel = Convert.toTopLevel(json);
+//
+// These functions will throw an error if the JSON doesn't
+// match the expected interface, even if the JSON is valid.
+
+export type TopLevel = {
+    a: A;
+    b: B;
+    [property: string]: mixed;
+};
+
+export type A = {
+    in:   C[];
+    name: string;
+    [property: string]: mixed;
+};
+
+export type C = {
+    name: string;
+    [property: string]: mixed;
+};
+
+export type B = {
+    name: string;
+    out:  C[];
+    [property: string]: mixed;
+};
+
+// Converts JSON strings to/from your types
+// and asserts the results of JSON.parse at runtime
+function toA(json: string): A {
+    return cast(JSON.parse(json), r("A"));
+}
+
+function aToJson(value: A): string {
+    return JSON.stringify(uncast(value, r("A")), null, 2);
+}
+
+function toB(json: string): B {
+    return cast(JSON.parse(json), r("B"));
+}
+
+function bToJson(value: B): string {
+    return JSON.stringify(uncast(value, r("B")), null, 2);
+}
+
+function toC(json: string): C {
+    return cast(JSON.parse(json), r("C"));
+}
+
+function cToJson(value: C): string {
+    return JSON.stringify(uncast(value, r("C")), null, 2);
+}
+
+function toTopLevel(json: string): TopLevel {
+    return cast(JSON.parse(json), r("TopLevel"));
+}
+
+function topLevelToJson(value: TopLevel): string {
+    return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
+}
+
+function invalidValue(typ: any, val: any, key: any, parent: any = '') {
+    const prettyTyp = prettyTypeName(typ);
+    const parentText = parent ? ` on ${parent}` : '';
+    const keyText = key ? ` for key "${key}"` : '';
+    throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
+}
+
+function prettyTypeName(typ: any): string {
+    if (Array.isArray(typ)) {
+        if (typ.length === 2 && typ[0] === undefined) {
+            return `an optional ${prettyTypeName(typ[1])}`;
+        } else {
+            return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
+        }
+    } else if (typeof typ === "object" && typ.literal !== undefined) {
+        return typ.literal;
+    } else {
+        return typeof typ;
+    }
+}
+
+function jsonToJSProps(typ: any): any {
+    if (typ.jsonToJS === undefined) {
+        const map: any = {};
+        typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ });
+        typ.jsonToJS = map;
+    }
+    return typ.jsonToJS;
+}
+
+function jsToJSONProps(typ: any): any {
+    if (typ.jsToJSON === undefined) {
+        const map: any = {};
+        typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ });
+        typ.jsToJSON = map;
+    }
+    return typ.jsToJSON;
+}
+
+function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any {
+    function transformPrimitive(typ: string, val: any): any {
+        if (typeof typ === typeof val) return val;
+        return invalidValue(typ, val, key, parent);
+    }
+
+    function transformUnion(typs: any[], val: any): any {
+        // val must validate against one typ in typs
+        const l = typs.length;
+        for (let i = 0; i < l; i++) {
+            const typ = typs[i];
+            try {
+                return transform(val, typ, getProps);
+            } catch (_) {}
+        }
+        return invalidValue(typs, val, key, parent);
+    }
+
+    function transformEnum(cases: string[], val: any): any {
+        if (cases.indexOf(val) !== -1) return val;
+        return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
+    }
+
+    function transformArray(typ: any, val: any): any {
+        // val must be an array with no invalid elements
+        if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent);
+        return val.map(el => transform(el, typ, getProps));
+    }
+
+    function transformDate(val: any): any {
+        if (val === null) {
+            return null;
+        }
+        const d = new Date(val);
+        if (isNaN(d.valueOf())) {
+            return invalidValue(l("Date"), val, key, parent);
+        }
+        return d;
+    }
+
+    function transformObject(props: { [k: string]: any }, additional: any, val: any): any {
+        if (val === null || typeof val !== "object" || Array.isArray(val)) {
+            return invalidValue(l(ref || "object"), val, key, parent);
+        }
+        const result: any = {};
+        Object.getOwnPropertyNames(props).forEach(key => {
+            const prop = props[key];
+            const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
+            result[prop.key] = transform(v, prop.typ, getProps, key, ref);
+        });
+        Object.getOwnPropertyNames(val).forEach(key => {
+            if (!Object.prototype.hasOwnProperty.call(props, key)) {
+                result[key] = transform(val[key], additional, getProps, key, ref);
+            }
+        });
+        return result;
+    }
+
+    if (typ === "any") return val;
+    if (typ === null) {
+        if (val === null) return val;
+        return invalidValue(typ, val, key, parent);
+    }
+    if (typ === false) return invalidValue(typ, val, key, parent);
+    let ref: any = undefined;
+    while (typeof typ === "object" && typ.ref !== undefined) {
+        ref = typ.ref;
+        typ = typeMap[typ.ref];
+    }
+    if (Array.isArray(typ)) return transformEnum(typ, val);
+    if (typeof typ === "object") {
+        return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
+            : typ.hasOwnProperty("arrayItems")    ? transformArray(typ.arrayItems, val)
+            : typ.hasOwnProperty("props")         ? transformObject(getProps(typ), typ.additional, val)
+            : invalidValue(typ, val, key, parent);
+    }
+    // Numbers can be parsed by Date but shouldn't be.
+    if (typ === Date && typeof val !== "number") return transformDate(val);
+    return transformPrimitive(typ, val);
+}
+
+function cast<T>(val: any, typ: any): T {
+    return transform(val, typ, jsonToJSProps);
+}
+
+function uncast<T>(val: T, typ: any): any {
+    return transform(val, typ, jsToJSONProps);
+}
+
+function l(typ: any) {
+    return { literal: typ };
+}
+
+function a(typ: any) {
+    return { arrayItems: typ };
+}
+
+function u(...typs: any[]) {
+    return { unionMembers: typs };
+}
+
+function o(props: any[], additional: any) {
+    return { props, additional };
+}
+
+function m(additional: any) {
+    const props: any[] = [];
+    return { props, additional };
+}
+
+function r(name: string) {
+    return { ref: name };
+}
+
+const typeMap: any = {
+    "TopLevel": o([
+        { json: "a", js: "a", typ: r("A") },
+        { json: "b", js: "b", typ: r("B") },
+    ], "any"),
+    "A": o([
+        { json: "in", js: "in", typ: a(r("C")) },
+        { json: "name", js: "name", typ: "" },
+    ], "any"),
+    "C": o([
+        { json: "name", js: "name", typ: "" },
+    ], "any"),
+    "B": o([
+        { json: "name", js: "name", typ: "" },
+        { json: "out", js: "out", typ: a(r("C")) },
+    ], "any"),
+};
+
+module.exports = {
+    "aToJson": aToJson,
+    "toA": toA,
+    "bToJson": bToJson,
+    "toB": toB,
+    "cToJson": cToJson,
+    "toC": toC,
+    "topLevelToJson": topLevelToJson,
+    "toTopLevel": toTopLevel,
+};
diff --git a/head/schema-golang/test/inputs/schema/issue-1833/default/quicktype.go b/head/schema-golang/test/inputs/schema/issue-1833/default/quicktype.go
new file mode 100644
index 0000000..83a3749
--- /dev/null
+++ b/head/schema-golang/test/inputs/schema/issue-1833/default/quicktype.go
@@ -0,0 +1,77 @@
+// Code generated from JSON Schema using quicktype. DO NOT EDIT.
+// To parse and unparse this JSON data, add this code to your project and do:
+//
+//    a, err := UnmarshalA(bytes)
+//    bytes, err = a.Marshal()
+//
+//    b, err := UnmarshalB(bytes)
+//    bytes, err = b.Marshal()
+//
+//    c, err := UnmarshalC(bytes)
+//    bytes, err = c.Marshal()
+//
+//    topLevel, err := UnmarshalTopLevel(bytes)
+//    bytes, err = topLevel.Marshal()
+
+package main
+
+import "encoding/json"
+
+func UnmarshalA(data []byte) (A, error) {
+	var r A
+	err := json.Unmarshal(data, &r)
+	return r, err
+}
+
+func (r *A) Marshal() ([]byte, error) {
+	return json.Marshal(r)
+}
+
+func UnmarshalB(data []byte) (B, error) {
+	var r B
+	err := json.Unmarshal(data, &r)
+	return r, err
+}
+
+func (r *B) Marshal() ([]byte, error) {
+	return json.Marshal(r)
+}
+
+func UnmarshalC(data []byte) (C, error) {
+	var r C
+	err := json.Unmarshal(data, &r)
+	return r, err
+}
+
+func (r *C) Marshal() ([]byte, error) {
+	return json.Marshal(r)
+}
+
+func UnmarshalTopLevel(data []byte) (TopLevel, error) {
+	var r TopLevel
+	err := json.Unmarshal(data, &r)
+	return r, err
+}
+
+func (r *TopLevel) Marshal() ([]byte, error) {
+	return json.Marshal(r)
+}
+
+type TopLevel struct {
+	A A `json:"a"`
+	B B `json:"b"`
+}
+
+type A struct {
+	In   []C    `json:"in"`
+	Name string `json:"name"`
+}
+
+type C struct {
+	Name string `json:"name"`
+}
+
+type B struct {
+	Name string `json:"name"`
+	Out  []C    `json:"out"`
+}
diff --git a/head/schema-javascript/test/inputs/schema/issue-1833/default/TopLevel.js b/head/schema-javascript/test/inputs/schema/issue-1833/default/TopLevel.js
new file mode 100644
index 0000000..448ca18
--- /dev/null
+++ b/head/schema-javascript/test/inputs/schema/issue-1833/default/TopLevel.js
@@ -0,0 +1,227 @@
+// To parse this data:
+//
+//   const Convert = require("./TopLevel");
+//
+//   const a = Convert.toA(json);
+//   const b = Convert.toB(json);
+//   const c = Convert.toC(json);
+//   const topLevel = Convert.toTopLevel(json);
+//
+// These functions will throw an error if the JSON doesn't
+// match the expected interface, even if the JSON is valid.
+
+// Converts JSON strings to/from your types
+// and asserts the results of JSON.parse at runtime
+function toA(json) {
+    return cast(JSON.parse(json), r("A"));
+}
+
+function aToJson(value) {
+    return JSON.stringify(uncast(value, r("A")), null, 2);
+}
+
+function toB(json) {
+    return cast(JSON.parse(json), r("B"));
+}
+
+function bToJson(value) {
+    return JSON.stringify(uncast(value, r("B")), null, 2);
+}
+
+function toC(json) {
+    return cast(JSON.parse(json), r("C"));
+}
+
+function cToJson(value) {
+    return JSON.stringify(uncast(value, r("C")), null, 2);
+}
+
+function toTopLevel(json) {
+    return cast(JSON.parse(json), r("TopLevel"));
+}
+
+function topLevelToJson(value) {
+    return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
+}
+
+function invalidValue(typ, val, key, parent = '') {
+    const prettyTyp = prettyTypeName(typ);
+    const parentText = parent ? ` on ${parent}` : '';
+    const keyText = key ? ` for key "${key}"` : '';
+    throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
+}
+
+function prettyTypeName(typ) {
+    if (Array.isArray(typ)) {
+        if (typ.length === 2 && typ[0] === undefined) {
+            return `an optional ${prettyTypeName(typ[1])}`;
+        } else {
+            return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
+        }
+    } else if (typeof typ === "object" && typ.literal !== undefined) {
+        return typ.literal;
+    } else {
+        return typeof typ;
+    }
+}
+
+function jsonToJSProps(typ) {
+    if (typ.jsonToJS === undefined) {
+        const map = {};
+        typ.props.forEach((p) => map[p.json] = { key: p.js, typ: p.typ });
+        typ.jsonToJS = map;
+    }
+    return typ.jsonToJS;
+}
+
+function jsToJSONProps(typ) {
+    if (typ.jsToJSON === undefined) {
+        const map = {};
+        typ.props.forEach((p) => map[p.js] = { key: p.json, typ: p.typ });
+        typ.jsToJSON = map;
+    }
+    return typ.jsToJSON;
+}
+
+function transform(val, typ, getProps, key = '', parent = '') {
+    function transformPrimitive(typ, val) {
+        if (typeof typ === typeof val) return val;
+        return invalidValue(typ, val, key, parent);
+    }
+
+    function transformUnion(typs, val) {
+        // val must validate against one typ in typs
+        const l = typs.length;
+        for (let i = 0; i < l; i++) {
+            const typ = typs[i];
+            try {
+                return transform(val, typ, getProps);
+            } catch (_) {}
+        }
+        return invalidValue(typs, val, key, parent);
+    }
+
+    function transformEnum(cases, val) {
+        if (cases.indexOf(val) !== -1) return val;
+        return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
+    }
+
+    function transformArray(typ, val) {
+        // val must be an array with no invalid elements
+        if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent);
+        return val.map(el => transform(el, typ, getProps));
+    }
+
+    function transformDate(val) {
+        if (val === null) {
+            return null;
+        }
+        const d = new Date(val);
+        if (isNaN(d.valueOf())) {
+            return invalidValue(l("Date"), val, key, parent);
+        }
+        return d;
+    }
+
+    function transformObject(props, additional, val) {
+        if (val === null || typeof val !== "object" || Array.isArray(val)) {
+            return invalidValue(l(ref || "object"), val, key, parent);
+        }
+        const result = {};
+        Object.getOwnPropertyNames(props).forEach(key => {
+            const prop = props[key];
+            const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
+            result[prop.key] = transform(v, prop.typ, getProps, key, ref);
+        });
+        Object.getOwnPropertyNames(val).forEach(key => {
+            if (!Object.prototype.hasOwnProperty.call(props, key)) {
+                result[key] = transform(val[key], additional, getProps, key, ref);
+            }
+        });
+        return result;
+    }
+
+    if (typ === "any") return val;
+    if (typ === null) {
+        if (val === null) return val;
+        return invalidValue(typ, val, key, parent);
+    }
+    if (typ === false) return invalidValue(typ, val, key, parent);
+    let ref = undefined;
+    while (typeof typ === "object" && typ.ref !== undefined) {
+        ref = typ.ref;
+        typ = typeMap[typ.ref];
+    }
+    if (Array.isArray(typ)) return transformEnum(typ, val);
+    if (typeof typ === "object") {
+        return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
+            : typ.hasOwnProperty("arrayItems")    ? transformArray(typ.arrayItems, val)
+            : typ.hasOwnProperty("props")         ? transformObject(getProps(typ), typ.additional, val)
+            : invalidValue(typ, val, key, parent);
+    }
+    // Numbers can be parsed by Date but shouldn't be.
+    if (typ === Date && typeof val !== "number") return transformDate(val);
+    return transformPrimitive(typ, val);
+}
+
+function cast(val, typ) {
+    return transform(val, typ, jsonToJSProps);
+}
+
+function uncast(val, typ) {
+    return transform(val, typ, jsToJSONProps);
+}
+
+function l(typ) {
+    return { literal: typ };
+}
+
+function a(typ) {
+    return { arrayItems: typ };
+}
+
+function u(...typs) {
+    return { unionMembers: typs };
+}
+
+function o(props, additional) {
+    return { props, additional };
+}
+
+function m(additional) {
+    const props = [];
+    return { props, additional };
+}
+
+function r(name) {
+    return { ref: name };
+}
+
+const typeMap = {
+    "TopLevel": o([
+        { json: "a", js: "a", typ: r("A") },
+        { json: "b", js: "b", typ: r("B") },
+    ], "any"),
+    "A": o([
+        { json: "in", js: "in", typ: a(r("C")) },
+        { json: "name", js: "name", typ: "" },
+    ], "any"),
+    "C": o([
+        { json: "name", js: "name", typ: "" },
+    ], "any"),
+    "B": o([
+        { json: "name", js: "name", typ: "" },
+        { json: "out", js: "out", typ: a(r("C")) },
+    ], "any"),
+};
+
+module.exports = {
+    "aToJson": aToJson,
+    "toA": toA,
+    "bToJson": bToJson,
+    "toB": toB,
+    "cToJson": cToJson,
+    "toC": toC,
+    "topLevelToJson": topLevelToJson,
+    "toTopLevel": toTopLevel,
+};
diff --git a/head/schema-kotlin/test/inputs/schema/issue-1833/default/TopLevel.kt b/head/schema-kotlin/test/inputs/schema/issue-1833/default/TopLevel.kt
new file mode 100644
index 0000000..472b7aa
--- /dev/null
+++ b/head/schema-kotlin/test/inputs/schema/issue-1833/default/TopLevel.kt
@@ -0,0 +1,57 @@
+// To parse the JSON, install Klaxon and do:
+//
+//   val a = A.fromJson(jsonString)
+//   val b = B.fromJson(jsonString)
+//   val c = C.fromJson(jsonString)
+//   val topLevel = TopLevel.fromJson(jsonString)
+
+package quicktype
+
+import com.beust.klaxon.*
+
+private val klaxon = Klaxon()
+
+data class TopLevel (
+    val a: A,
+    val b: B
+) {
+    public fun toJson() = klaxon.toJsonString(this)
+
+    companion object {
+        public fun fromJson(json: String) = klaxon.parse<TopLevel>(json)
+    }
+}
+
+data class A (
+    @Json(name = "in")
+    val aIn: List<C>,
+
+    val name: String
+) {
+    public fun toJson() = klaxon.toJsonString(this)
+
+    companion object {
+        public fun fromJson(json: String) = klaxon.parse<A>(json)
+    }
+}
+
+data class C (
+    val name: String
+) {
+    public fun toJson() = klaxon.toJsonString(this)
+
+    companion object {
+        public fun fromJson(json: String) = klaxon.parse<C>(json)
+    }
+}
+
+data class B (
+    val name: String,
+    val out: List<C>
+) {
+    public fun toJson() = klaxon.toJsonString(this)
+
+    companion object {
+        public fun fromJson(json: String) = klaxon.parse<B>(json)
+    }
+}
diff --git a/head/schema-kotlin-jackson/test/inputs/schema/issue-1833/default/TopLevel.kt b/head/schema-kotlin-jackson/test/inputs/schema/issue-1833/default/TopLevel.kt
new file mode 100644
index 0000000..caefb2c
--- /dev/null
+++ b/head/schema-kotlin-jackson/test/inputs/schema/issue-1833/default/TopLevel.kt
@@ -0,0 +1,75 @@
+// To parse the JSON, install jackson-module-kotlin and do:
+//
+//   val a = A.fromJson(jsonString)
+//   val b = B.fromJson(jsonString)
+//   val c = C.fromJson(jsonString)
+//   val topLevel = TopLevel.fromJson(jsonString)
+
+package quicktype
+
+import com.fasterxml.jackson.annotation.*
+import com.fasterxml.jackson.core.*
+import com.fasterxml.jackson.databind.*
+import com.fasterxml.jackson.databind.deser.std.StdDeserializer
+import com.fasterxml.jackson.databind.module.SimpleModule
+import com.fasterxml.jackson.databind.node.*
+import com.fasterxml.jackson.databind.ser.std.StdSerializer
+import com.fasterxml.jackson.module.kotlin.*
+
+val mapper = jacksonObjectMapper().apply {
+    propertyNamingStrategy = PropertyNamingStrategy.LOWER_CAMEL_CASE
+    setSerializationInclusion(JsonInclude.Include.NON_NULL)
+}
+
+data class TopLevel (
+    @get:JsonProperty(required=true)@field:JsonProperty(required=true)
+    val a: A,
+
+    @get:JsonProperty(required=true)@field:JsonProperty(required=true)
+    val b: B
+) {
+    fun toJson() = mapper.writeValueAsString(this)
+
+    companion object {
+        fun fromJson(json: String) = mapper.readValue<TopLevel>(json)
+    }
+}
+
+data class A (
+    @get:JsonProperty("in", required=true)@field:JsonProperty("in", required=true)
+    val aIn: List<C>,
+
+    @get:JsonProperty(required=true)@field:JsonProperty(required=true)
+    val name: String
+) {
+    fun toJson() = mapper.writeValueAsString(this)
+
+    companion object {
+        fun fromJson(json: String) = mapper.readValue<A>(json)
+    }
+}
+
+data class C (
+    @get:JsonProperty(required=true)@field:JsonProperty(required=true)
+    val name: String
+) {
+    fun toJson() = mapper.writeValueAsString(this)
+
+    companion object {
+        fun fromJson(json: String) = mapper.readValue<C>(json)
+    }
+}
+
+data class B (
+    @get:JsonProperty(required=true)@field:JsonProperty(required=true)
+    val name: String,
+
+    @get:JsonProperty(required=true)@field:JsonProperty(required=true)
+    val out: List<C>
+) {
+    fun toJson() = mapper.writeValueAsString(this)
+
+    companion object {
+        fun fromJson(json: String) = mapper.readValue<B>(json)
+    }
+}
diff --git a/head/schema-kotlinx/test/inputs/schema/issue-1833/default/TopLevel.kt b/head/schema-kotlinx/test/inputs/schema/issue-1833/default/TopLevel.kt
new file mode 100644
index 0000000..1f8dc3a
--- /dev/null
+++ b/head/schema-kotlinx/test/inputs/schema/issue-1833/default/TopLevel.kt
@@ -0,0 +1,39 @@
+// To parse the JSON, install kotlin's serialization plugin and do:
+//
+// val json     = Json { allowStructuredMapKeys = true }
+// val a        = json.parse(A.serializer(), jsonString)
+// val b        = json.parse(B.serializer(), jsonString)
+// val c        = json.parse(C.serializer(), jsonString)
+// val topLevel = json.parse(TopLevel.serializer(), jsonString)
+
+package quicktype
+
+import kotlinx.serialization.*
+import kotlinx.serialization.json.*
+import kotlinx.serialization.descriptors.*
+import kotlinx.serialization.encoding.*
+
+@Serializable
+data class TopLevel (
+    val a: A,
+    val b: B
+)
+
+@Serializable
+data class A (
+    @SerialName("in")
+    val aIn: List<C>,
+
+    val name: String
+)
+
+@Serializable
+data class C (
+    val name: String
+)
+
+@Serializable
+data class B (
+    val name: String,
+    val out: List<C>
+)
diff --git a/head/schema-php/test/inputs/schema/issue-1833/default/TopLevel.php b/head/schema-php/test/inputs/schema/issue-1833/default/TopLevel.php
new file mode 100644
index 0000000..59eebd9
--- /dev/null
+++ b/head/schema-php/test/inputs/schema/issue-1833/default/TopLevel.php
@@ -0,0 +1,582 @@
+<?php
+declare(strict_types=1);
+
+// This is an autogenerated file:TopLevel
+
+class TopLevel {
+    private A $a; // json:a Required
+    private B $b; // json:b Required
+
+    /**
+     * @param A $a
+     * @param B $b
+     */
+    public function __construct(A $a, B $b) {
+        $this->a = $a;
+        $this->b = $b;
+    }
+
+    /**
+     * @param stdClass $value
+     * @throws Exception
+     * @return A
+     */
+    public static function fromA(stdClass $value): A {
+        return A::from($value); /*class*/
+    }
+
+    /**
+     * @throws Exception
+     * @return stdClass
+     */
+    public function toA(): stdClass {
+        if (TopLevel::validateA($this->a))  {
+            return $this->a->to(); /*class*/
+        }
+        throw new Exception('never get to this TopLevel::a');
+    }
+
+    /**
+     * @param A
+     * @return bool
+     * @throws Exception
+     */
+    public static function validateA(A $value): bool {
+        $value->validate();
+        return true;
+    }
+
+    /**
+     * @throws Exception
+     * @return A
+     */
+    public function getA(): A {
+        if (TopLevel::validateA($this->a))  {
+            return $this->a;
+        }
+        throw new Exception('never get to getA TopLevel::a');
+    }
+
+    /**
+     * @return A
+     */
+    public static function sampleA(): A {
+        return A::sample(); /*31:a*/
+    }
+
+    /**
+     * @param stdClass $value
+     * @throws Exception
+     * @return B
+     */
+    public static function fromB(stdClass $value): B {
+        return B::from($value); /*class*/
+    }
+
+    /**
+     * @throws Exception
+     * @return stdClass
+     */
+    public function toB(): stdClass {
+        if (TopLevel::validateB($this->b))  {
+            return $this->b->to(); /*class*/
+        }
+        throw new Exception('never get to this TopLevel::b');
+    }
+
+    /**
+     * @param B
+     * @return bool
+     * @throws Exception
+     */
+    public static function validateB(B $value): bool {
+        $value->validate();
+        return true;
+    }
+
+    /**
+     * @throws Exception
+     * @return B
+     */
+    public function getB(): B {
+        if (TopLevel::validateB($this->b))  {
+            return $this->b;
+        }
+        throw new Exception('never get to getB TopLevel::b');
+    }
+
+    /**
+     * @return B
+     */
+    public static function sampleB(): B {
+        return B::sample(); /*32:b*/
+    }
+
+    /**
+     * @throws Exception
+     * @return bool
+     */
+    public function validate(): bool {
+        return TopLevel::validateA($this->a)
+        || TopLevel::validateB($this->b);
+    }
+
+    /**
+     * @return stdClass
+     * @throws Exception
+     */
+    public function to(): stdClass  {
+        $out = new stdClass();
+        $out->{'a'} = $this->toA();
+        $out->{'b'} = $this->toB();
+        return $out;
+    }
+
+    /**
+     * @param stdClass $obj
+     * @return TopLevel
+     * @throws Exception
+     */
+    public static function from(stdClass $obj): TopLevel {
+        return new TopLevel(
+         TopLevel::fromA($obj->{'a'})
+        ,TopLevel::fromB($obj->{'b'})
+        );
+    }
+
+    /**
+     * @return TopLevel
+     */
+    public static function sample(): TopLevel {
+        return new TopLevel(
+         TopLevel::sampleA()
+        ,TopLevel::sampleB()
+        );
+    }
+}
+
+// This is an autogenerated file:A
+
+class A {
+    private array $in; // json:in Required
+    private string $name; // json:name Required
+
+    /**
+     * @param array $in
+     * @param string $name
+     */
+    public function __construct(array $in, string $name) {
+        $this->in = $in;
+        $this->name = $name;
+    }
+
+    /**
+     * @param array $value
+     * @throws Exception
+     * @return array
+     */
+    public static function fromIn(array $value): array {
+        return  array_map(function ($value) {
+            return C::from($value); /*class*/
+        }, $value);
+    }
+
+    /**
+     * @throws Exception
+     * @return array
+     */
+    public function toIn(): array {
+        if (A::validateIn($this->in))  {
+            return array_map(function ($value) {
+                return $value->to(); /*class*/
+            }, $this->in);
+        }
+        throw new Exception('never get to this A::in');
+    }
+
+    /**
+     * @param array
+     * @return bool
+     * @throws Exception
+     */
+    public static function validateIn(array $value): bool {
+        if (!is_array($value)) {
+            throw new Exception("Attribute Error:A::in");
+        }
+        array_walk($value, function($value_v) {
+            $value_v->validate();
+        });
+        return true;
+    }
+
+    /**
+     * @throws Exception
+     * @return array
+     */
+    public function getIn(): array {
+        if (A::validateIn($this->in))  {
+            return $this->in;
+        }
+        throw new Exception('never get to getIn A::in');
+    }
+
+    /**
+     * @return array
+     */
+    public static function sampleIn(): array {
+        return  array(
+            C::sample() /*31:*/
+        ); /* 31:in*/
+    }
+
+    /**
+     * @param string $value
+     * @throws Exception
+     * @return string
+     */
+    public static function fromName(string $value): string {
+        return $value; /*string*/
+    }
+
+    /**
+     * @throws Exception
+     * @return string
+     */
+    public function toName(): string {
+        if (A::validateName($this->name))  {
+            return $this->name; /*string*/
+        }
+        throw new Exception('never get to this A::name');
+    }
+
+    /**
+     * @param string
+     * @return bool
+     * @throws Exception
+     */
+    public static function validateName(string $value): bool {
+        return true;
+    }
+
+    /**
+     * @throws Exception
+     * @return string
+     */
+    public function getName(): string {
+        if (A::validateName($this->name))  {
+            return $this->name;
+        }
+        throw new Exception('never get to getName A::name');
+    }
+
+    /**
+     * @return string
+     */
+    public static function sampleName(): string {
+        return 'A::name::32'; /*32:name*/
+    }
+
+    /**
+     * @throws Exception
+     * @return bool
+     */
+    public function validate(): bool {
+        return A::validateIn($this->in)
+        || A::validateName($this->name);
+    }
+
+    /**
+     * @return stdClass
+     * @throws Exception
+     */
+    public function to(): stdClass  {
+        $out = new stdClass();
+        $out->{'in'} = $this->toIn();
+        $out->{'name'} = $this->toName();
+        return $out;
+    }
+
+    /**
+     * @param stdClass $obj
+     * @return A
+     * @throws Exception
+     */
+    public static function from(stdClass $obj): A {
+        return new A(
+         A::fromIn($obj->{'in'})
+        ,A::fromName($obj->{'name'})
+        );
+    }
+
+    /**
+     * @return A
+     */
+    public static function sample(): A {
+        return new A(
+         A::sampleIn()
+        ,A::sampleName()
+        );
+    }
+}
+
+// This is an autogenerated file:C
+
+class C {
+    private string $name; // json:name Required
+
+    /**
+     * @param string $name
+     */
+    public function __construct(string $name) {
+        $this->name = $name;
+    }
+
+    /**
+     * @param string $value
+     * @throws Exception
+     * @return string
+     */
+    public static function fromName(string $value): string {
+        return $value; /*string*/
+    }
+
+    /**
+     * @throws Exception
+     * @return string
+     */
+    public function toName(): string {
+        if (C::validateName($this->name))  {
+            return $this->name; /*string*/
+        }
+        throw new Exception('never get to this C::name');
+    }
+
+    /**
+     * @param string
+     * @return bool
+     * @throws Exception
+     */
+    public static function validateName(string $value): bool {
+        return true;
+    }
+
+    /**
+     * @throws Exception
+     * @return string
+     */
+    public function getName(): string {
+        if (C::validateName($this->name))  {
+            return $this->name;
+        }
+        throw new Exception('never get to getName C::name');
+    }
+
+    /**
+     * @return string
+     */
+    public static function sampleName(): string {
+        return 'C::name::31'; /*31:name*/
+    }
+
+    /**
+     * @throws Exception
+     * @return bool
+     */
+    public function validate(): bool {
+        return C::validateName($this->name);
+    }
+
+    /**
+     * @return stdClass
+     * @throws Exception
+     */
+    public function to(): stdClass  {
+        $out = new stdClass();
+        $out->{'name'} = $this->toName();
+        return $out;
+    }
+
+    /**
+     * @param stdClass $obj
+     * @return C
+     * @throws Exception
+     */
+    public static function from(stdClass $obj): C {
+        return new C(
+         C::fromName($obj->{'name'})
+        );
+    }
+
+    /**
+     * @return C
+     */
+    public static function sample(): C {
+        return new C(
+         C::sampleName()
+        );
+    }
+}
+
+// This is an autogenerated file:B
+
+class B {
+    private string $name; // json:name Required
+    private array $out; // json:out Required
+
+    /**
+     * @param string $name
+     * @param array $out
+     */
+    public function __construct(string $name, array $out) {
+        $this->name = $name;
+        $this->out = $out;
+    }
+
+    /**
+     * @param string $value
+     * @throws Exception
+     * @return string
+     */
+    public static function fromName(string $value): string {
+        return $value; /*string*/
+    }
+
+    /**
+     * @throws Exception
+     * @return string
+     */
+    public function toName(): string {
+        if (B::validateName($this->name))  {
+            return $this->name; /*string*/
+        }
+        throw new Exception('never get to this B::name');
+    }
+
+    /**
+     * @param string
+     * @return bool
+     * @throws Exception
+     */
+    public static function validateName(string $value): bool {
+        return true;
+    }
+
+    /**
+     * @throws Exception
+     * @return string
+     */
+    public function getName(): string {
+        if (B::validateName($this->name))  {
+            return $this->name;
+        }
+        throw new Exception('never get to getName B::name');
+    }
+
+    /**
+     * @return string
+     */
+    public static function sampleName(): string {
+        return 'B::name::31'; /*31:name*/
+    }
+
+    /**
+     * @param array $value
+     * @throws Exception
+     * @return array
+     */
+    public static function fromOut(array $value): array {
+        return  array_map(function ($value) {
+            return C::from($value); /*class*/
+        }, $value);
+    }
+
+    /**
+     * @throws Exception
+     * @return array
+     */
+    public function toOut(): array {
+        if (B::validateOut($this->out))  {
+            return array_map(function ($value) {
+                return $value->to(); /*class*/
+            }, $this->out);
+        }
+        throw new Exception('never get to this B::out');
+    }
+
+    /**
+     * @param array
+     * @return bool
+     * @throws Exception
+     */
+    public static function validateOut(array $value): bool {
+        if (!is_array($value)) {
+            throw new Exception("Attribute Error:B::out");
+        }
+        array_walk($value, function($value_v) {
+            $value_v->validate();
+        });
+        return true;
+    }
+
+    /**
+     * @throws Exception
+     * @return array
+     */
+    public function getOut(): array {
+        if (B::validateOut($this->out))  {
+            return $this->out;
+        }
+        throw new Exception('never get to getOut B::out');
+    }
+
+    /**
+     * @return array
+     */
+    public static function sampleOut(): array {
+        return  array(
+            C::sample() /*32:*/
+        ); /* 32:out*/
+    }
+
+    /**
+     * @throws Exception
+     * @return bool
+     */
+    public function validate(): bool {
+        return B::validateName($this->name)
+        || B::validateOut($this->out);
+    }
+
+    /**
+     * @return stdClass
+     * @throws Exception
+     */
+    public function to(): stdClass  {
+        $out = new stdClass();
+        $out->{'name'} = $this->toName();
+        $out->{'out'} = $this->toOut();
+        return $out;
+    }
+
+    /**
+     * @param stdClass $obj
+     * @return B
+     * @throws Exception
+     */
+    public static function from(stdClass $obj): B {
+        return new B(
+         B::fromName($obj->{'name'})
+        ,B::fromOut($obj->{'out'})
+        );
+    }
+
+    /**
+     * @return B
+     */
+    public static function sample(): B {
+        return new B(
+         B::sampleName()
+        ,B::sampleOut()
+        );
+    }
+}
diff --git a/head/schema-pike/test/inputs/schema/issue-1833/default/TopLevel.pmod b/head/schema-pike/test/inputs/schema/issue-1833/default/TopLevel.pmod
new file mode 100644
index 0000000..5b70899
--- /dev/null
+++ b/head/schema-pike/test/inputs/schema/issue-1833/default/TopLevel.pmod
@@ -0,0 +1,102 @@
+// This source has been automatically generated by quicktype.
+// ( https://github.com/quicktype/quicktype )
+//
+// To use this code, simply import it into your project as a Pike module.
+// To JSON-encode your object, you can pass it to `Standards.JSON.encode`
+// or call `encode_json` on it.
+//
+// To decode a JSON string, first pass it to `Standards.JSON.decode`,
+// and then pass the result to `<YourClass>_from_JSON`.
+// It will return an instance of <YourClass>.
+// Bear in mind that these functions have unexpected behavior,
+// and will likely throw an error, if the JSON string does not
+// match the expected interface, even if the JSON itself is valid.
+
+class TopLevel {
+    A a; // json: "a"
+    B b; // json: "b"
+
+    string encode_json() {
+        mapping(string:mixed) json = ([
+            "a" : a,
+            "b" : b,
+        ]);
+
+        return Standards.JSON.encode(json);
+    }
+}
+
+TopLevel TopLevel_from_JSON(mixed json) {
+    TopLevel retval = TopLevel();
+
+    retval.a = json["a"];
+    retval.b = json["b"];
+
+    return retval;
+}
+
+class A {
+    array(C) in;   // json: "in"
+    string   name; // json: "name"
+
+    string encode_json() {
+        mapping(string:mixed) json = ([
+            "in" : in,
+            "name" : name,
+        ]);
+
+        return Standards.JSON.encode(json);
+    }
+}
+
+A A_from_JSON(mixed json) {
+    A retval = A();
+
+    retval.in = json["in"];
+    retval.name = json["name"];
+
+    return retval;
+}
+
+class C {
+    string name; // json: "name"
+
+    string encode_json() {
+        mapping(string:mixed) json = ([
+            "name" : name,
+        ]);
+
+        return Standards.JSON.encode(json);
+    }
+}
+
+C C_from_JSON(mixed json) {
+    C retval = C();
+
+    retval.name = json["name"];
+
+    return retval;
+}
+
+class B {
+    string   name; // json: "name"
+    array(C) out;  // json: "out"
+
+    string encode_json() {
+        mapping(string:mixed) json = ([
+            "name" : name,
+            "out" : out,
+        ]);
+
+        return Standards.JSON.encode(json);
+    }
+}
+
+B B_from_JSON(mixed json) {
+    B retval = B();
+
+    retval.name = json["name"];
+    retval.out = json["out"];
+
+    return retval;
+}
diff --git a/head/schema-python/test/inputs/schema/issue-1833/default/quicktype.py b/head/schema-python/test/inputs/schema/issue-1833/default/quicktype.py
new file mode 100644
index 0000000..324eac9
--- /dev/null
+++ b/head/schema-python/test/inputs/schema/issue-1833/default/quicktype.py
@@ -0,0 +1,125 @@
+from dataclasses import dataclass
+from typing import Any, TypeVar, Callable, Type, cast
+
+
+T = TypeVar("T")
+
+
+def from_str(x: Any) -> str:
+    assert isinstance(x, str)
+    return x
+
+
+def from_list(f: Callable[[Any], T], x: Any) -> list[T]:
+    assert isinstance(x, list)
+    return [f(y) for y in x]
+
+
+def to_class(c: Type[T], x: Any) -> dict:
+    assert isinstance(x, c)
+    return cast(Any, x).to_dict()
+
+
+@dataclass
+class C:
+    name: str
+
+    @staticmethod
+    def from_dict(obj: Any) -> 'C':
+        assert isinstance(obj, dict)
+        name = from_str(obj.get("name"))
+        return C(name)
+
+    def to_dict(self) -> dict:
+        result: dict = {}
+        result["name"] = from_str(self.name)
+        return result
+
+
+@dataclass
+class A:
+    a_in: list[C]
+    name: str
+
+    @staticmethod
+    def from_dict(obj: Any) -> 'A':
+        assert isinstance(obj, dict)
+        a_in = from_list(C.from_dict, obj.get("in"))
+        name = from_str(obj.get("name"))
+        return A(a_in, name)
+
+    def to_dict(self) -> dict:
+        result: dict = {}
+        result["in"] = from_list(lambda x: to_class(C, x), self.a_in)
+        result["name"] = from_str(self.name)
+        return result
+
+
+@dataclass
+class B:
+    name: str
+    out: list[C]
+
+    @staticmethod
+    def from_dict(obj: Any) -> 'B':
+        assert isinstance(obj, dict)
+        name = from_str(obj.get("name"))
+        out = from_list(C.from_dict, obj.get("out"))
+        return B(name, out)
+
+    def to_dict(self) -> dict:
+        result: dict = {}
+        result["name"] = from_str(self.name)
+        result["out"] = from_list(lambda x: to_class(C, x), self.out)
+        return result
+
+
+@dataclass
+class TopLevel:
+    a: A
+    b: B
+
+    @staticmethod
+    def from_dict(obj: Any) -> 'TopLevel':
+        assert isinstance(obj, dict)
+        a = A.from_dict(obj.get("a"))
+        b = B.from_dict(obj.get("b"))
+        return TopLevel(a, b)
+
+    def to_dict(self) -> dict:
+        result: dict = {}
+        result["a"] = to_class(A, self.a)
+        result["b"] = to_class(B, self.b)
+        return result
+
+
+def a_from_dict(s: Any) -> A:
+    return A.from_dict(s)
+
+
+def a_to_dict(x: A) -> Any:
+    return to_class(A, x)
+
+
+def b_from_dict(s: Any) -> B:
+    return B.from_dict(s)
+
+
+def b_to_dict(x: B) -> Any:
+    return to_class(B, x)
+
+
+def c_from_dict(s: Any) -> C:
+    return C.from_dict(s)
+
+
+def c_to_dict(x: C) -> Any:
+    return to_class(C, x)
+
+
+def top_level_from_dict(s: Any) -> TopLevel:
+    return TopLevel.from_dict(s)
+
+
+def top_level_to_dict(x: TopLevel) -> Any:
+    return to_class(TopLevel, x)
diff --git a/head/schema-ruby/test/inputs/schema/issue-1833/default/TopLevel.rb b/head/schema-ruby/test/inputs/schema/issue-1833/default/TopLevel.rb
new file mode 100644
index 0000000..1174605
--- /dev/null
+++ b/head/schema-ruby/test/inputs/schema/issue-1833/default/TopLevel.rb
@@ -0,0 +1,138 @@
+# This code may look unusually verbose for Ruby (and it is), but
+# it performs some subtle and complex validation of JSON data.
+#
+# To parse this JSON, add 'dry-struct' and 'dry-types' gems, then do:
+#
+#   a = A.from_json! "{…}"
+#   puts a.a_in.first.c_name
+#
+#   b = B.from_json! "{…}"
+#   puts b.out.first.c_name
+#
+#   c = C.from_json! "{…}"
+#   puts c.c_name
+#
+#   top_level = TopLevel.from_json! "{…}"
+#   puts top_level.b.out.first.c_name
+#
+# If from_json! succeeds, the value returned matches the schema.
+
+require 'json'
+require 'dry-types'
+require 'dry-struct'
+
+module Types
+  include Dry.Types(default: :nominal)
+
+  Hash   = Strict::Hash
+  String = Strict::String
+end
+
+class C < Dry::Struct
+  attribute :c_name, Types::String
+
+  def self.from_dynamic!(d)
+    d = Types::Hash[d]
+    new(
+      c_name: d.fetch("name"),
+    )
+  end
+
+  def self.from_json!(json)
+    from_dynamic!(JSON.parse(json))
+  end
+
+  def to_dynamic
+    {
+      "name" => c_name,
+    }
+  end
+
+  def to_json(options = nil)
+    JSON.generate(to_dynamic, options)
+  end
+end
+
+class A < Dry::Struct
+  attribute :a_in,   Types.Array(C)
+  attribute :a_name, Types::String
+
+  def self.from_dynamic!(d)
+    d = Types::Hash[d]
+    new(
+      a_in:   d.fetch("in").map { |x| C.from_dynamic!(x) },
+      a_name: d.fetch("name"),
+    )
+  end
+
+  def self.from_json!(json)
+    from_dynamic!(JSON.parse(json))
+  end
+
+  def to_dynamic
+    {
+      "in"   => a_in.map { |x| x.to_dynamic },
+      "name" => a_name,
+    }
+  end
+
+  def to_json(options = nil)
+    JSON.generate(to_dynamic, options)
+  end
+end
+
+class B < Dry::Struct
+  attribute :b_name, Types::String
+  attribute :out,    Types.Array(C)
+
+  def self.from_dynamic!(d)
+    d = Types::Hash[d]
+    new(
+      b_name: d.fetch("name"),
+      out:    d.fetch("out").map { |x| C.from_dynamic!(x) },
+    )
+  end
+
+  def self.from_json!(json)
+    from_dynamic!(JSON.parse(json))
+  end
+
+  def to_dynamic
+    {
+      "name" => b_name,
+      "out"  => out.map { |x| x.to_dynamic },
+    }
+  end
+
+  def to_json(options = nil)
+    JSON.generate(to_dynamic, options)
+  end
+end
+
+class TopLevel < Dry::Struct
+  attribute :a, A
+  attribute :b, B
+
+  def self.from_dynamic!(d)
+    d = Types::Hash[d]
+    new(
+      a: A.from_dynamic!(d.fetch("a")),
+      b: B.from_dynamic!(d.fetch("b")),
+    )
+  end
+
+  def self.from_json!(json)
+    from_dynamic!(JSON.parse(json))
+  end
+
+  def to_dynamic
+    {
+      "a" => a.to_dynamic,
+      "b" => b.to_dynamic,
+    }
+  end
+
+  def to_json(options = nil)
+    JSON.generate(to_dynamic, options)
+  end
+end
diff --git a/head/schema-rust/test/inputs/schema/issue-1833/default/module_under_test.rs b/head/schema-rust/test/inputs/schema/issue-1833/default/module_under_test.rs
new file mode 100644
index 0000000..0b8404e
--- /dev/null
+++ b/head/schema-rust/test/inputs/schema/issue-1833/default/module_under_test.rs
@@ -0,0 +1,41 @@
+// Example code that deserializes and serializes the model.
+// extern crate serde;
+// #[macro_use]
+// extern crate serde_derive;
+// extern crate serde_json;
+//
+// use generated_module::A;
+//
+// fn main() {
+//     let json = r#"{"answer": 42}"#;
+//     let model: A = serde_json::from_str(&json).unwrap();
+// }
+
+use serde::{Serialize, Deserialize};
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct TopLevel {
+    pub a: A,
+
+    pub b: B,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct A {
+    #[serde(rename = "in")]
+    pub a_in: Vec<C>,
+
+    pub name: String,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct C {
+    pub name: String,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct B {
+    pub name: String,
+
+    pub out: Vec<C>,
+}
diff --git a/head/schema-scala3/test/inputs/schema/issue-1833/default/TopLevel.scala b/head/schema-scala3/test/inputs/schema/issue-1833/default/TopLevel.scala
new file mode 100644
index 0000000..d9255da
--- /dev/null
+++ b/head/schema-scala3/test/inputs/schema/issue-1833/default/TopLevel.scala
@@ -0,0 +1,27 @@
+package quicktype
+
+import io.circe.syntax._
+import io.circe._
+import cats.syntax.functor._
+
+// If a union has a null in, then we'll need this too... 
+type NullValue = None.type
+
+case class TopLevel (
+    val a : A,
+    val b : B
+) derives Encoder.AsObject, Decoder
+
+case class A (
+    val in : Seq[C],
+    val name : String
+) derives Encoder.AsObject, Decoder
+
+case class C (
+    val name : String
+) derives Encoder.AsObject, Decoder
+
+case class B (
+    val name : String,
+    val out : Seq[C]
+) derives Encoder.AsObject, Decoder
diff --git a/head/schema-scala3-upickle/test/inputs/schema/issue-1833/default/TopLevel.scala b/head/schema-scala3-upickle/test/inputs/schema/issue-1833/default/TopLevel.scala
new file mode 100644
index 0000000..5b7c0fd
--- /dev/null
+++ b/head/schema-scala3-upickle/test/inputs/schema/issue-1833/default/TopLevel.scala
@@ -0,0 +1,85 @@
+package quicktype
+
+// Custom pickler so that missing keys and JSON nulls both read as None,
+// and None is left out when writing (upickle's default for Option is a
+// JSON array).
+object OptionPickler extends upickle.AttributeTagged:
+    import upickle.default.Writer
+    import upickle.default.Reader
+    override implicit def OptionWriter[T: Writer]: Writer[Option[T]] =
+        implicitly[Writer[T]].comap[Option[T]] {
+            case None => null.asInstanceOf[T]
+            case Some(x) => x
+        }
+
+    override implicit def OptionReader[T: Reader]: Reader[Option[T]] = {
+        new Reader.Delegate[Any, Option[T]](implicitly[Reader[T]].map(Some(_))){
+        override def visitNull(index: Int) = None
+        }
+    }
+end OptionPickler
+
+// If a union has a null in, then we'll need this too...
+type NullValue = None.type
+given OptionPickler.ReadWriter[NullValue] = OptionPickler.readwriter[ujson.Value].bimap[NullValue](
+    _ => ujson.Null,
+    json => if json.isNull then None else throw new upickle.core.Abort("not null")
+)
+
+object JsonExt:
+    val valueReader = OptionPickler.readwriter[ujson.Value]
+
+    // upickle's built-in primitive readers are lenient -- the numeric and
+    // boolean readers accept strings, and the string reader accepts
+    // numbers and booleans -- so untagged unions need strict readers to
+    // pick the right member.
+    val strictString: OptionPickler.Reader[String] = valueReader.map {
+        case ujson.Str(s) => s
+        case json => throw new upickle.core.Abort("expected string, got " + json)
+    }
+    val strictLong: OptionPickler.Reader[Long] = valueReader.map {
+        case ujson.Num(n) if n.isWhole => n.toLong
+        case json => throw new upickle.core.Abort("expected integer, got " + json)
+    }
+    val strictDouble: OptionPickler.Reader[Double] = valueReader.map {
+        case ujson.Num(n) => n
+        case json => throw new upickle.core.Abort("expected number, got " + json)
+    }
+    val strictBoolean: OptionPickler.Reader[Boolean] = valueReader.map {
+        case ujson.Bool(b) => b
+        case json => throw new upickle.core.Abort("expected boolean, got " + json)
+    }
+
+    def badMerge[T](r1: => OptionPickler.Reader[?], rest: OptionPickler.Reader[?]*): OptionPickler.Reader[T] = valueReader.map { json =>
+        var t: T | Null = null
+        val stack       = Vector.newBuilder[Throwable]
+        (r1 +: rest).foreach { reader =>
+            if t == null then
+            try
+                t = OptionPickler.read[T](json, trace = true)(using reader.asInstanceOf[OptionPickler.Reader[T]])
+            catch
+                case exc => stack += exc
+        }
+        if t != null then t.nn else throw new Exception(json.toString(), stack.result().headOption.getOrElse(null))
+    }
+end JsonExt
+
+
+case class TopLevel (
+    val a : A,
+    val b : B
+) derives OptionPickler.ReadWriter
+
+case class A (
+    val in : Seq[C],
+    val name : String
+) derives OptionPickler.ReadWriter
+
+case class C (
+    val name : String
+) derives OptionPickler.ReadWriter
+
+case class B (
+    val name : String,
+    val out : Seq[C]
+) derives OptionPickler.ReadWriter
diff --git a/head/schema-schema/test/inputs/schema/issue-1833/default/TopLevel.schema b/head/schema-schema/test/inputs/schema/issue-1833/default/TopLevel.schema
new file mode 100644
index 0000000..3e0aece
--- /dev/null
+++ b/head/schema-schema/test/inputs/schema/issue-1833/default/TopLevel.schema
@@ -0,0 +1,75 @@
+{
+    "$schema": "http://json-schema.org/draft-06/schema#",
+    "definitions": {
+        "TopLevel": {
+            "type": "object",
+            "additionalProperties": {},
+            "properties": {
+                "a": {
+                    "$ref": "#/definitions/A"
+                },
+                "b": {
+                    "$ref": "#/definitions/B"
+                }
+            },
+            "required": [
+                "a",
+                "b"
+            ],
+            "title": "TopLevel"
+        },
+        "A": {
+            "type": "object",
+            "additionalProperties": {},
+            "properties": {
+                "in": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/C"
+                    }
+                },
+                "name": {
+                    "type": "string"
+                }
+            },
+            "required": [
+                "in",
+                "name"
+            ],
+            "title": "A"
+        },
+        "C": {
+            "type": "object",
+            "additionalProperties": {},
+            "properties": {
+                "name": {
+                    "type": "string"
+                }
+            },
+            "required": [
+                "name"
+            ],
+            "title": "C"
+        },
+        "B": {
+            "type": "object",
+            "additionalProperties": {},
+            "properties": {
+                "name": {
+                    "type": "string"
+                },
+                "out": {
+                    "type": "array",
+                    "items": {
+                        "$ref": "#/definitions/C"
+                    }
+                }
+            },
+            "required": [
+                "name",
+                "out"
+            ],
+            "title": "B"
+        }
+    }
+}
diff --git a/head/schema-typescript/test/inputs/schema/issue-1833/default/TopLevel.ts b/head/schema-typescript/test/inputs/schema/issue-1833/default/TopLevel.ts
new file mode 100644
index 0000000..2fedde2
--- /dev/null
+++ b/head/schema-typescript/test/inputs/schema/issue-1833/default/TopLevel.ts
@@ -0,0 +1,241 @@
+// To parse this data:
+//
+//   import { Convert, A, B, C, TopLevel } from "./TopLevel";
+//
+//   const a = Convert.toA(json);
+//   const b = Convert.toB(json);
+//   const c = Convert.toC(json);
+//   const topLevel = Convert.toTopLevel(json);
+//
+// These functions will throw an error if the JSON doesn't
+// match the expected interface, even if the JSON is valid.
+
+export interface TopLevel {
+    a: A;
+    b: B;
+    [property: string]: unknown;
+}
+
+export interface A {
+    in:   C[];
+    name: string;
+    [property: string]: unknown;
+}
+
+export interface C {
+    name: string;
+    [property: string]: unknown;
+}
+
+export interface B {
+    name: string;
+    out:  C[];
+    [property: string]: unknown;
+}
+
+// Converts JSON strings to/from your types
+// and asserts the results of JSON.parse at runtime
+export class Convert {
+    public static toA(json: string): A {
+        return cast(JSON.parse(json), r("A"));
+    }
+
+    public static aToJson(value: A): string {
+        return JSON.stringify(uncast(value, r("A")), null, 2);
+    }
+
+    public static toB(json: string): B {
+        return cast(JSON.parse(json), r("B"));
+    }
+
+    public static bToJson(value: B): string {
+        return JSON.stringify(uncast(value, r("B")), null, 2);
+    }
+
+    public static toC(json: string): C {
+        return cast(JSON.parse(json), r("C"));
+    }
+
+    public static cToJson(value: C): string {
+        return JSON.stringify(uncast(value, r("C")), null, 2);
+    }
+
+    public static toTopLevel(json: string): TopLevel {
+        return cast(JSON.parse(json), r("TopLevel"));
+    }
+
+    public static topLevelToJson(value: TopLevel): string {
+        return JSON.stringify(uncast(value, r("TopLevel")), null, 2);
+    }
+}
+
+function invalidValue(typ: any, val: any, key: any, parent: any = ''): never {
+    const prettyTyp = prettyTypeName(typ);
+    const parentText = parent ? ` on ${parent}` : '';
+    const keyText = key ? ` for key "${key}"` : '';
+    throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`);
+}
+
+function prettyTypeName(typ: any): string {
+    if (Array.isArray(typ)) {
+        if (typ.length === 2 && typ[0] === undefined) {
+            return `an optional ${prettyTypeName(typ[1])}`;
+        } else {
+            return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`;
+        }
+    } else if (typeof typ === "object" && typ.literal !== undefined) {
+        return typ.literal;
+    } else {
+        return typeof typ;
+    }
+}
+
+function jsonToJSProps(typ: any): any {
+    if (typ.jsonToJS === undefined) {
+        const map: any = {};
+        typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ });
+        typ.jsonToJS = map;
+    }
+    return typ.jsonToJS;
+}
+
+function jsToJSONProps(typ: any): any {
+    if (typ.jsToJSON === undefined) {
+        const map: any = {};
+        typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ });
+        typ.jsToJSON = map;
+    }
+    return typ.jsToJSON;
+}
+
+function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any {
+    function transformPrimitive(typ: string, val: any): any {
+        if (typeof typ === typeof val) return val;
+        return invalidValue(typ, val, key, parent);
+    }
+
+    function transformUnion(typs: any[], val: any): any {
+        // val must validate against one typ in typs
+        const l = typs.length;
+        for (let i = 0; i < l; i++) {
+            const typ = typs[i];
+            try {
+                return transform(val, typ, getProps);
+            } catch (_) {}
+        }
+        return invalidValue(typs, val, key, parent);
+    }
+
+    function transformEnum(cases: string[], val: any): any {
+        if (cases.indexOf(val) !== -1) return val;
+        return invalidValue(cases.map(a => { return l(a); }), val, key, parent);
+    }
+
+    function transformArray(typ: any, val: any): any {
+        // val must be an array with no invalid elements
+        if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent);
+        return val.map(el => transform(el, typ, getProps));
+    }
+
+    function transformDate(val: any): any {
+        if (val === null) {
+            return null;
+        }
+        const d = new Date(val);
+        if (isNaN(d.valueOf())) {
+            return invalidValue(l("Date"), val, key, parent);
+        }
+        return d;
+    }
+
+    function transformObject(props: { [k: string]: any }, additional: any, val: any): any {
+        if (val === null || typeof val !== "object" || Array.isArray(val)) {
+            return invalidValue(l(ref || "object"), val, key, parent);
+        }
+        const result: any = {};
+        Object.getOwnPropertyNames(props).forEach(key => {
+            const prop = props[key];
+            const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined;
+            result[prop.key] = transform(v, prop.typ, getProps, key, ref);
+        });
+        Object.getOwnPropertyNames(val).forEach(key => {
+            if (!Object.prototype.hasOwnProperty.call(props, key)) {
+                result[key] = transform(val[key], additional, getProps, key, ref);
+            }
+        });
+        return result;
+    }
+
+    if (typ === "any") return val;
+    if (typ === null) {
+        if (val === null) return val;
+        return invalidValue(typ, val, key, parent);
+    }
+    if (typ === false) return invalidValue(typ, val, key, parent);
+    let ref: any = undefined;
+    while (typeof typ === "object" && typ.ref !== undefined) {
+        ref = typ.ref;
+        typ = typeMap[typ.ref];
+    }
+    if (Array.isArray(typ)) return transformEnum(typ, val);
+    if (typeof typ === "object") {
+        return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val)
+            : typ.hasOwnProperty("arrayItems")    ? transformArray(typ.arrayItems, val)
+            : typ.hasOwnProperty("props")         ? transformObject(getProps(typ), typ.additional, val)
+            : invalidValue(typ, val, key, parent);
+    }
+    // Numbers can be parsed by Date but shouldn't be.
+    if (typ === Date && typeof val !== "number") return transformDate(val);
+    return transformPrimitive(typ, val);
+}
+
+function cast<T>(val: any, typ: any): T {
+    return transform(val, typ, jsonToJSProps);
+}
+
+function uncast<T>(val: T, typ: any): any {
+    return transform(val, typ, jsToJSONProps);
+}
+
+function l(typ: any) {
+    return { literal: typ };
+}
+
+function a(typ: any) {
+    return { arrayItems: typ };
+}
+
+function u(...typs: any[]) {
+    return { unionMembers: typs };
+}
+
+function o(props: any[], additional: any) {
+    return { props, additional };
+}
+
+function m(additional: any) {
+    const props: any[] = [];
+    return { props, additional };
+}
+
+function r(name: string) {
+    return { ref: name };
+}
+
+const typeMap: any = {
+    "TopLevel": o([
+        { json: "a", js: "a", typ: r("A") },
+        { json: "b", js: "b", typ: r("B") },
+    ], "any"),
+    "A": o([
+        { json: "in", js: "in", typ: a(r("C")) },
+        { json: "name", js: "name", typ: "" },
+    ], "any"),
+    "C": o([
+        { json: "name", js: "name", typ: "" },
+    ], "any"),
+    "B": o([
+        { json: "name", js: "name", typ: "" },
+        { json: "out", js: "out", typ: a(r("C")) },
+    ], "any"),
+};
