diff --git a/lib/openapi3_parser/source/reference_resolver.rb b/lib/openapi3_parser/source/reference_resolver.rb
index <HASH>..<HASH> 100644
--- a/lib/openapi3_parser/source/reference_resolver.rb
+++ b/lib/openapi3_parser/source/reference_resolver.rb
@@ -16,7 +16,7 @@ module Openapi3Parser
         @reference_factory ||= begin
                                  next_context = Context.reference_field(
                                    context,
-                                   input: data,
+                                   input: source.data_at_pointer(json_pointer),
                                    source: source,
                                    pointer_segments: json_pointer
                                  )
@@ -24,8 +24,8 @@ module Openapi3Parser
                                end
       end
 
-      def data
-        source.data_at_pointer(json_pointer)
+      def resolved_input
+        reference_factory.resolved_input
       end
 
       def valid?
Use resolved_input from factory rather than data

Using data only resolved the first reference, whereas if we use the
factory that can recursively resolve all the references so there aren't
further references in the output.