     return nil
   }
 
-  func resolve(document: [String: Any], fragment: String) -> [String: Any]? {
+  func resolve(document: [String: Any], fragment: String) -> Any? {
     guard !fragment.isEmpty else {
       return document
     }

}

func urlJoin(_ lhs: String, _ rhs: String) -> String {
  if rhs.hasPrefix("#") {
    return lhs + rhs
  }
  return rhs
}

func urlNormalise(_ value: String) -> String {

            continue
          }
        }
      } else if let subschema = schema[component] as? Bool {
        if !components.isEmpty {
          return nil
        }
        return subschema
      }

      return nil
