diff --git a/python_jsonschema_objects/classbuilder.py b/python_jsonschema_objects/classbuilder.py
index 8178397..809095e 100644
--- a/python_jsonschema_objects/classbuilder.py
+++ b/python_jsonschema_objects/classbuilder.py
@@ -399,9 +399,20 @@ class TypeRef(object):
 
 
 class TypeProxy(object):
-    def __init__(self, types):
+    slots = ("__title__", "_types")
+
+    def __init__(self, types, title=None):
+        self.__title__ = title
         self._types = types
 
+    def from_json(self, jsonmsg):
+        import json
+
+        msg = json.loads(jsonmsg)
+        obj = self(**msg)
+        obj.validate()
+        return obj
+
     def __call__(self, *a, **kw):
         validation_errors = []
         valid_types = self._types
@@ -434,25 +445,44 @@ class ClassBuilder(object):
         self.resolved = {}
         self.under_construction = set()
 
-    def resolve_classes(self, iterable):
+    def expand_references(self, source_uri, iterable):
+        """ Give an iterable of jsonschema descriptors, expands any
+        of them that are $ref objects, and otherwise leaves them alone. 
+        """
         pp = []
         for elem in iterable:
             if "$ref" in elem:
-                ref = elem["$ref"]
-                uri = util.resolve_ref_uri(self.resolver.resolution_scope, ref)
-                if uri in self.resolved:
-                    pp.append(self.resolved[uri])
-                else:
-                    with self.resolver.resolving(ref) as resolved:
-                        self.resolved[uri] = self.construct(
-                            uri, resolved, (ProtocolBase,)
-                        )
-                        pp.append(self.resolved[uri])
+                pp.append(self.resolve_type(elem["$ref"], source_uri))
             else:
                 pp.append(elem)
 
         return pp
 
+    def resolve_type(self, ref, source):
+        """ Return a resolved type for a URI, potentially constructing one if necessary"""
+        uri = util.resolve_ref_uri(self.resolver.resolution_scope, ref)
+        if uri in self.resolved:
+            return self.resolved[uri]
+
+        elif uri in self.under_construction:
+            logger.debug(
+                util.lazy_format(
+                    "Using a TypeRef to avoid a cyclic reference for {0} -> {1} ",
+                    uri,
+                    source,
+                )
+            )
+            return TypeRef(uri, self.resolved)
+        else:
+            logger.debug(
+                util.lazy_format(
+                    "Resolving direct reference object {0} -> {1}", source, uri
+                )
+            )
+            with self.resolver.resolving(ref) as resolved:
+                self.resolved[uri] = self.construct(uri, resolved, (ProtocolBase,))
+                return self.resolved[uri]
+
     def construct(self, uri, *args, **kw):
         """ Wrapper to debug things """
         logger.debug(util.lazy_format("Constructing {0}", uri))
@@ -472,11 +502,19 @@ class ClassBuilder(object):
             raise NotImplementedError("anyOf is not supported as bare property")
 
         elif "oneOf" in clsdata:
-            self.resolved[uri] = self._build_object(uri, clsdata, parent, **kw)
+            """ If this object itself has a 'oneOf' designation, 
+            then construct a TypeProxy.
+            """
+            klasses = self.construct_objects(clsdata["oneOf"], uri)
+
+            logger.debug(
+                util.lazy_format("Designating {0} as TypeProxy for {1}", uri, klasses)
+            )
+            self.resolved[uri] = TypeProxy(klasses, title=clsdata.get("title"))
             return self.resolved[uri]
 
         elif "allOf" in clsdata:
-            potential_parents = self.resolve_classes(clsdata["allOf"])
+            potential_parents = self.expand_references(uri, clsdata["allOf"])
             parents = []
             for p in potential_parents:
                 if isinstance(p, dict):
@@ -509,25 +547,8 @@ class ClassBuilder(object):
                 )
             else:
                 ref = clsdata["$ref"]
-                refuri = util.resolve_ref_uri(self.resolver.resolution_scope, ref)
-                if refuri in self.under_construction:
-                    logger.debug(
-                        util.lazy_format(
-                            "Resolving cyclic reference from {0} to {1}.", uri, refuri
-                        )
-                    )
-                    return TypeRef(refuri, self.resolved)
-                else:
-                    logger.debug(
-                        util.lazy_format(
-                            "Resolving direct reference object for {0}: {1}",
-                            uri,
-                            refuri,
-                        )
-                    )
-
-                    with self.resolver.resolving(refuri) as resolved:
-                        self.resolved[uri] = self.construct(refuri, resolved, parent)
+                typ = self.resolve_type(ref, uri)
+                self.resolved[uri] = typ
 
             return self.resolved[uri]
 
@@ -639,23 +660,14 @@ class ClassBuilder(object):
 
             elif "type" not in detail and "$ref" in detail:
                 ref = detail["$ref"]
-                uri = util.resolve_ref_uri(self.resolver.resolution_scope, ref)
-                logger.debug(
-                    util.lazy_format(
-                        "Resolving reference {0} for {1}.{2}", ref, nm, prop
-                    )
-                )
-                if uri in self.resolved:
-                    typ = self.resolved[uri]
-                else:
-                    typ = self.construct(uri, detail, (ProtocolBase,))
+                typ = self.resolve_type(ref, ".".join([nm, prop]))
 
                 props[prop] = make_property(prop, {"type": typ}, typ.__doc__)
-                properties[prop]["$ref"] = uri
+                properties[prop]["$ref"] = ref
                 properties[prop]["type"] = typ
 
             elif "oneOf" in detail:
-                potential = self.resolve_classes(detail["oneOf"])
+                potential = self.expand_references(nm, detail["oneOf"])
                 logger.debug(
                     util.lazy_format("Designating {0} as oneOf {1}", prop, potential)
                 )
@@ -665,16 +677,13 @@ class ClassBuilder(object):
             elif "type" in detail and detail["type"] == "array":
                 if "items" in detail and isinstance(detail["items"], dict):
                     if "$ref" in detail["items"]:
-                        uri = util.resolve_ref_uri(
-                            self.resolver.resolution_scope, detail["items"]["$ref"]
-                        )
-                        typ = self.construct(uri, detail["items"])
+                        typ = self.resolve_type(detail["items"]["$ref"], nm)
                         constraints = copy.copy(detail)
                         constraints["strict"] = kw.get("strict")
                         propdata = {
                             "type": "array",
                             "validator": python_jsonschema_objects.wrapper_types.ArrayWrapper.create(
-                                uri, item_constraint=typ, **constraints
+                                nm, item_constraint=typ, **constraints
                             ),
                         }
 
@@ -683,20 +692,9 @@ class ClassBuilder(object):
                         try:
                             if "oneOf" in detail["items"]:
                                 typ = TypeProxy(
-                                    [
-                                        self.construct(uri + "_%s" % i, item_detail)
-                                        if "$ref" not in item_detail
-                                        else self.construct(
-                                            util.resolve_ref_uri(
-                                                self.resolver.resolution_scope,
-                                                item_detail["$ref"],
-                                            ),
-                                            item_detail,
-                                        )
-                                        for i, item_detail in enumerate(
-                                            detail["items"]["oneOf"]
-                                        )
-                                    ]
+                                    self.construct_objects(
+                                        detail["items"]["oneOf"], uri
+                                    )
                                 )
                             else:
                                 typ = self.construct(uri, detail["items"])
@@ -738,14 +736,6 @@ class ClassBuilder(object):
 
                 props[prop] = make_property(prop, {"type": typ}, desc)
 
-        """ If this object itself has a 'oneOf' designation, then
-        make the validation 'type' the list of potential objects.
-        """
-        if "oneOf" in clsdata:
-            klasses = self.resolve_classes(clsdata["oneOf"])
-            # Need a validation to check that it meets one of them
-            props["__validation__"] = {"type": klasses}
-
         props["__extensible__"] = pattern_properties.ExtensibleValidator(
             nm, clsdata, self
         )
@@ -777,6 +767,14 @@ class ClassBuilder(object):
 
         return cls
 
+    def construct_objects(self, oneOfList, uri):
+        return [
+            self.construct(uri + "_%s" % i, item_detail)
+            if "$ref" not in item_detail
+            else self.resolve_type(item_detail["$ref"], uri + "_%s" % i)
+            for i, item_detail in enumerate(oneOfList)
+        ]
+
 
 def make_property(prop, info, desc=""):
     from . import descriptors
diff --git a/python_jsonschema_objects/pattern_properties.py b/python_jsonschema_objects/pattern_properties.py
index 2ebdf1b..c4a07a6 100644
--- a/python_jsonschema_objects/pattern_properties.py
+++ b/python_jsonschema_objects/pattern_properties.py
@@ -30,7 +30,7 @@ class ExtensibleValidator(object):
             self._additional_type = True
         else:
             if "$ref" in addlProp:
-                refs = builder.resolve_classes([addlProp])
+                typ = builder.resolve_type(addlProp["$ref"], name)
             else:
                 uri = "{0}/{1}_{2}".format(
                     name, "<additionalProperties>", "<anonymous>"
@@ -38,23 +38,23 @@ class ExtensibleValidator(object):
                 builder.resolved[uri] = builder.construct(
                     uri, addlProp, (cb.ProtocolBase,)
                 )
-                refs = [builder.resolved[uri]]
+                typ = builder.resolved[uri]
 
-            self._additional_type = refs[0]
+            self._additional_type = typ
 
         for pattern, typedef in six.iteritems(schemadef.get("patternProperties", {})):
             if "$ref" in typedef:
-                refs = builder.resolve_classes([typedef])
+                typ = builder.resolve_type(typedef["$ref"], name)
             else:
                 uri = "{0}/{1}_{2}".format(name, "<patternProperties>", pattern)
 
                 builder.resolved[uri] = builder.construct(
                     uri, typedef, (cb.ProtocolBase,)
                 )
-                refs = [builder.resolved[uri]]
+                typ = builder.resolved[uri]
 
             self._pattern_types.append(
-                PatternDef(pattern=re.compile(pattern), schema_type=refs[0])
+                PatternDef(pattern=re.compile(pattern), schema_type=typ)
             )
 
     def _make_type(self, typ, val):
diff --git a/python_jsonschema_objects/wrapper_types.py b/python_jsonschema_objects/wrapper_types.py
index c2ce58f..4d7ea91 100644
--- a/python_jsonschema_objects/wrapper_types.py
+++ b/python_jsonschema_objects/wrapper_types.py
@@ -251,7 +251,9 @@ class ArrayWrapper(collections.MutableSequence):
         )
         from python_jsonschema_objects import classbuilder
 
-        klassbuilder = addl_constraints.pop("classbuilder", None)
+        klassbuilder = addl_constraints.pop(
+            "classbuilder", None
+        )  # type: python_jsonschema_objects.classbuilder.ClassBuilder
         props = {}
 
         if item_constraint is not None:
@@ -290,23 +292,9 @@ class ArrayWrapper(collections.MutableSequence):
                             )
                         )
 
-                    uri = item_constraint["$ref"]
-                    if uri in klassbuilder.resolved:
-                        logger.debug(
-                            util.lazy_format(
-                                "Using previously resolved object for {0}", uri
-                            )
-                        )
-                    else:
-                        logger.debug(util.lazy_format("Resolving object for {0}", uri))
-
-                        with klassbuilder.resolver.resolving(uri) as resolved:
-                            # Set incase there is a circular reference in schema definition
-                            klassbuilder.resolved[uri] = klassbuilder.construct(
-                                uri, resolved, (classbuilder.ProtocolBase,)
-                            )
-
-                    item_constraint = klassbuilder.resolved[uri]
+                    item_constraint = klassbuilder.resolve_type(
+                        item_constraint["$ref"], name
+                    )
 
                 elif isdict and item_constraint.get("type") == "array":
                     # We need to create a sub-array validator.
@@ -318,22 +306,9 @@ class ArrayWrapper(collections.MutableSequence):
                 elif isdict and "oneOf" in item_constraint:
                     # We need to create a TypeProxy validator
                     uri = "{0}_{1}".format(name, "<anonymous_list_type>")
-                    type_array = []
-                    for i, item_detail in enumerate(item_constraint["oneOf"]):
-                        if "$ref" in item_detail:
-                            subtype = klassbuilder.construct(
-                                util.resolve_ref_uri(
-                                    klassbuilder.resolver.resolution_scope,
-                                    item_detail["$ref"],
-                                ),
-                                item_detail,
-                            )
-                        else:
-                            subtype = klassbuilder.construct(
-                                uri + "_%s" % i, item_detail
-                            )
-
-                        type_array.append(subtype)
+                    type_array = klassbuilder.construct_objects(
+                        item_constraint["oneOf"], uri
+                    )
 
                     item_constraint = classbuilder.TypeProxy(type_array)
 

oneOf array of simple types bug - propose fix
```
basicSchemaDefn = {
  '$schema': 'http://json-schema.org/draft-04/schema#',
  'title': 'Test',
  'properties': {
    'SimpleArrayOfNumberOrString': {
      '$ref': '#/definitions/simparray'
    }
  },
  'required': [
    'SimpleArrayOfNumberOrString'
  ],
  'type': 'object',
  'definitions': {
    'simparray': {
      'oneOf': [{
          'type': 'array',
          'items': {
            'type': 'number'
          }
        },
        {
          'type': 'array',
          'items': {
            'type': 'string'
          }
        }
      ]
    }
  }
}

builder = pjs.ObjectBuilder(basicSchemaDefn)

ns = builder.build_classes()
ns.Test().from_json('{"SimpleArrayOfNumberOrString" : [0, 1]}')
```


diff --git a/test/test_feature_151.py b/test/test_feature_151.py
new file mode 100644
index 0000000..3798287
--- /dev/null
+++ b/test/test_feature_151.py
@@ -0,0 +1,31 @@
+import pytest
+import python_jsonschema_objects as pjo
+
+
+def test_simple_array_oneOf():
+    basicSchemaDefn = {
+        "$schema": "http://json-schema.org/draft-04/schema#",
+        "title": "Test",
+        "properties": {
+            "SimpleArrayOfNumberOrString": {"$ref": "#/definitions/simparray"}
+        },
+        "required": ["SimpleArrayOfNumberOrString"],
+        "type": "object",
+        "definitions": {
+            "simparray": {
+                "oneOf": [
+                    {"type": "array", "items": {"type": "number"}},
+                    {"type": "array", "items": {"type": "string"}},
+                ]
+            }
+        },
+    }
+
+    builder = pjo.ObjectBuilder(basicSchemaDefn)
+
+    ns = builder.build_classes()
+    ns.Test().from_json('{"SimpleArrayOfNumberOrString" : [0, 1]}')
+    ns.Test().from_json('{"SimpleArrayOfNumberOrString" : ["Hi", "There"]}')
+
+    with pytest.raises(pjo.ValidationError):
+        ns.Test().from_json('{"SimpleArrayOfNumberOrString" : ["Hi", 0]}')
diff --git a/test/test_pytest.py b/test/test_pytest.py
index 2ae8a5e..b1106e1 100644
--- a/test/test_pytest.py
+++ b/test/test_pytest.py
@@ -529,3 +529,12 @@ def test_default_values(default):
 
     x = ns.Test()
     assert x.sample == default["default"]
+
+
+def test_justareference_example(markdown_examples):
+
+    builder = pjs.ObjectBuilder(
+        markdown_examples["Just a Reference"], resolved=markdown_examples
+    )
+    ns = builder.build_classes()
+    ns.JustAReference("Hello")
diff --git a/test/test_regression_156.py b/test/test_regression_156.py
index 138bbe0..48837bc 100644
--- a/test/test_regression_156.py
+++ b/test/test_regression_156.py
@@ -18,3 +18,11 @@ def test_regression_156(markdown_examples):
     # round-trip serialize-deserialize into class defined with `oneOf`
     classes.Multipleobjects.from_json(er.serialize())
     classes.Multipleobjects.from_json(vgr.serialize())
+
+
+def test_toplevel_oneof_gets_a_name(markdown_examples):
+    builder = pjo.ObjectBuilder(
+        markdown_examples["MultipleObjects"], resolved=markdown_examples
+    )
+    classes = builder.build_classes(named_only=True)
+    assert classes.Multipleobjects.__title__ is not None

pip install -e .[dev]
parse_log_pytest
requirements.txt
nose rednose pyandoc pandoc sphinx sphinx-autobuild recommonmark pytest
3.5
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
certifi==2021.5.30
charset-normalizer==2.0.12
colorama==0.4.5
commonmark==0.9.1
docutils==0.18.1
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
inflection==0.5.1
iniconfig==1.1.1
Jinja2==3.0.3
jsonschema==3.2.0
livereload==2.6.3
Markdown==3.3.7
MarkupSafe==2.0.1
nose==1.3.7
packaging==21.3
pandoc==2.4
pluggy==1.0.0
plumbum==1.8.3
ply==3.11
py==1.11.0
pyandoc==0.2.0
Pygments==2.14.0
pyparsing==3.1.4
pyrsistent==0.18.0
pytest==7.0.1
-e git+https://github.com/cwacek/python-jsonschema-objects.git@c4ace6de887690a04399c62a52ac6d481930c5a5#egg=python_jsonschema_objects
pytz==2025.2
recommonmark==0.7.1
rednose==1.3.0
requests==2.27.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinx-autobuild==2021.3.14
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
termstyle==0.1.11
tomli==1.2.3
tornado==6.1
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: python-jsonschema-objects
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - colorama==0.4.5
      - commonmark==0.9.1
      - docutils==0.18.1
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - inflection==0.5.1
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - jsonschema==3.2.0
      - livereload==2.6.3
      - markdown==3.3.7
      - markupsafe==2.0.1
      - nose==1.3.7
      - packaging==21.3
      - pandoc==2.4
      - pluggy==1.0.0
      - plumbum==1.8.3
      - ply==3.11
      - py==1.11.0
      - pyandoc==0.2.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pyrsistent==0.18.0
      - pytest==7.0.1
      - pytz==2025.2
      - recommonmark==0.7.1
      - rednose==1.3.0
      - requests==2.27.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinx-autobuild==2021.3.14
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - termstyle==0.1.11
      - tomli==1.2.3
      - tornado==6.1
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/python-jsonschema-objects

test/test_feature_151.py::test_simple_array_oneOf
test/test_pytest.py::test_warnings_on_schema_version[http://json-schema.org/schema#-True] test/test_pytest.py::test_warnings_on_schema_version[http://json-schema.org/draft-03/schema-False] test/test_pytest.py::test_warnings_on_schema_version[http://json-schema.org/draft-04/schema-False] test/test_pytest.py::test_warnings_on_schema_version[http://json-schema.org/draft-06/schema-True] test/test_pytest.py::test_warnings_on_schema_version[http://json-schema.org/draft-07/schema-True] test/test_pytest.py::test_schema_validation test/test_pytest.py::test_regression_9 test/test_pytest.py::test_build_classes_is_idempotent test/test_pytest.py::test_underscore_properties test/test_pytest.py::test_array_regressions test/test_pytest.py::test_arrays_can_have_reffed_items_of_mixed_type test/test_pytest.py::test_regression_39 test/test_pytest.py::test_loads_markdown_schema_extraction test/test_pytest.py::test_object_builder_loads_memory_references test/test_pytest.py::test_object_builder_reads_all_definitions test/test_pytest.py::test_oneOf_validates_against_any_valid[{"MyData": test/test_pytest.py::test_oneOf_fails_against_non_matching test/test_pytest.py::test_oneOfBare_validates_against_any_valid[{"MyAddress": test/test_pytest.py::test_oneOfBare_validates_against_any_valid[{"firstName": test/test_pytest.py::test_oneOfBare_fails_against_non_matching test/test_pytest.py::test_additional_props_allowed_by_default test/test_pytest.py::test_additional_props_permitted_explicitly test/test_pytest.py::test_still_raises_when_accessing_undefined_attrs test/test_pytest.py::test_permits_deletion_of_additional_properties test/test_pytest.py::test_additional_props_disallowed_explicitly test/test_pytest.py::test_objects_can_be_empty test/test_pytest.py::test_object_equality_should_compare_data test/test_pytest.py::test_object_allows_attributes_in_oncstructor test/test_pytest.py::test_object_validates_on_json_decode test/test_pytest.py::test_object_validates_enumerations test/test_pytest.py::test_validation_of_mixed_type_enums test/test_pytest.py::test_objects_allow_non_required_attrs_to_be_missing test/test_pytest.py::test_objects_require_required_attrs_on_validate test/test_pytest.py::test_attribute_access_via_dict test/test_pytest.py::test_attribute_set_via_dict test/test_pytest.py::test_keys_can_be_other_pjo_objects test/test_pytest.py::test_numeric_attribute_validation test/test_pytest.py::test_objects_validate_prior_to_serializing test/test_pytest.py::test_serializing_removes_null_objects test/test_pytest.py::test_lists_get_serialized_correctly test/test_pytest.py::test_dictionary_transformation[pdict0] test/test_pytest.py::test_dictionary_transformation[pdict1] test/test_pytest.py::test_strict_mode test/test_pytest.py::test_boolean_in_child_object test/test_pytest.py::test_default_values[{"type": test/test_pytest.py::test_justareference_example test/test_regression_156.py::test_regression_156 test/test_regression_156.py::test_toplevel_oneof_gets_a_name
python_jsonschema_objects/wrapper_types.py python_jsonschema_objects/classbuilder.py python_jsonschema_objects/pattern_properties.py
python_jsonschema_objects/wrapper_types.py python_jsonschema_objects/classbuilder.py python_jsonschema_objects/pattern_properties.py