martin-g commented on code in PR #579:
URL: https://github.com/apache/avro-rs/pull/579#discussion_r3570947400


##########
avro/src/types.rs:
##########
@@ -656,38 +687,70 @@ impl Value {
         }
     }
 
-    /// Attempt to perform schema resolution on the value, with the given
-    /// [Schema](../schema/enum.Schema.html).
+    /// Resolve this value into a new schema.
+    ///
+    /// Note: This will first build a reference map from the schema (see 
[`ResolvedSchema`]). If this
+    /// function is called more than once for the same schema, it is 
recommended to use
+    /// [`resolve_with_names`](Self::resolve_with_names) instead.
     ///
     /// See [Schema 
Resolution](https://avro.apache.org/docs/++version++/specification/#schema-resolution)
-    /// in the Avro specification for the full set of rules of schema
-    /// resolution.
+    /// in the Avro specification for the full set of rules of schema 
resolution.
     pub fn resolve(self, schema: &Schema) -> AvroResult<Self> {
         self.resolve_schemata(schema, Vec::with_capacity(0))
     }
 
-    /// Attempt to perform schema resolution on the value, with the given
-    /// [Schema](../schema/enum.Schema.html) and set of schemas to use for 
Refs resolution.
+    /// Resolve this value into a new schema using `schemata` to resolve any 
references.
+    ///
+    /// `schemata` must contain all referenced schemas in `schema`, including 
references to parts of
+    /// `schema` itself.
+    ///
+    /// Note: This will first build a reference map from the schema (see 
[`ResolvedSchema`]). If this
+    /// function is called more than once for the same schema, it is 
recommended to use
+    /// [`resolve_with_names`](Self::resolve_with_names) instead.
     ///
     /// See [Schema 
Resolution](https://avro.apache.org/docs/++version++/specification/#schema-resolution)
-    /// in the Avro specification for the full set of rules of schema
-    /// resolution.
+    /// in the Avro specification for the full set of rules of schema 
resolution.
     pub fn resolve_schemata(self, schema: &Schema, schemata: Vec<&Schema>) -> 
AvroResult<Self> {
-        let enclosing_namespace = schema.namespace();

Review Comment:
   I still do not understand.
   The idea of `enclosing_namespace` is to provide the namespace to any 
(grand)children schemas which do not have their own `"namespace"` attribute.
   If we pass `None` to 
https://github.com/apache/avro-rs/blob/7fda1076ab2c2d351f0e65631165d1b5ec8b5e24/avro/src/types.rs#L752
 then `resolve_record()` at 
https://github.com/apache/avro-rs/blob/7fda1076ab2c2d351f0e65631165d1b5ec8b5e24/avro/src/types.rs#L796
 will not know the namespace of the closest parent with a namespace.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to