You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Kriskras99 (via GitHub)" <gi...@apache.org> on 2026/06/22 19:57:21 UTC

[PR] fix: Enable `#[serde(remote = "..")]` support [avro-rs]

Kriskras99 opened a new pull request, #564:
URL: https://github.com/apache/avro-rs/pull/564

   Remote just works, doesn't need any changes.
   
   I have added a test to show how it works.


-- 
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: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Enable `#[serde(remote = "..")]` support [avro-rs]

Posted by "Kriskras99 (via GitHub)" <gi...@apache.org>.
Kriskras99 commented on PR #564:
URL: https://github.com/apache/avro-rs/pull/564#issuecomment-4775933247

   One thing that can improve this functionality is getting the name from the `remote` attribute (in the test the name of the schema will now be `DurationDef` instead of `Duration`)


-- 
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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Enable `#[serde(remote = "..")]` support [avro-rs]

Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g commented on code in PR #564:
URL: https://github.com/apache/avro-rs/pull/564#discussion_r3457591357


##########
avro_derive/src/attributes/serde.rs:
##########
@@ -117,8 +117,10 @@ pub struct ContainerAttributes {
     pub _default: Option<SerdeDefault>,
     /// This type is the serde implementation for a "remote" type.
     ///
-    /// This makes the (de)serialisation use/return a different type.
-    pub remote: Option<String>,
+    /// This makes the (de)serialisation use/return a different type. However, the this type should
+    /// match the other type so the schema we generate is correct.

Review Comment:
   It is not clear what `other type` is.
   
   I am saying it as someone who never never needed to use Serde `remote` before and I have not consulted with the Serde docs before making this comment. So, maybe it is clear enough for people trying to use this attribute.



-- 
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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Enable `#[serde(remote = "..")]` support [avro-rs]

Posted by "Kriskras99 (via GitHub)" <gi...@apache.org>.
Kriskras99 commented on code in PR #564:
URL: https://github.com/apache/avro-rs/pull/564#discussion_r3462220748


##########
avro_derive/src/attributes/serde.rs:
##########
@@ -117,8 +117,10 @@ pub struct ContainerAttributes {
     pub _default: Option<SerdeDefault>,
     /// This type is the serde implementation for a "remote" type.
     ///
-    /// This makes the (de)serialisation use/return a different type.
-    pub remote: Option<String>,
+    /// This makes the (de)serialisation use/return a different type. However, the this type should
+    /// match the other type so the schema we generate is correct.

Review Comment:
   I've tried to improve the documentation, but the best reference is the Serde docs itself. The most important part is that it doesn't affect the schema we generate.



-- 
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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Enable `#[serde(remote = "..")]` support [avro-rs]

Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g commented on code in PR #564:
URL: https://github.com/apache/avro-rs/pull/564#discussion_r3457591357


##########
avro_derive/src/attributes/serde.rs:
##########
@@ -117,8 +117,10 @@ pub struct ContainerAttributes {
     pub _default: Option<SerdeDefault>,
     /// This type is the serde implementation for a "remote" type.
     ///
-    /// This makes the (de)serialisation use/return a different type.
-    pub remote: Option<String>,
+    /// This makes the (de)serialisation use/return a different type. However, the this type should
+    /// match the other type so the schema we generate is correct.

Review Comment:
   It is not clear what `other type` is.
   
   I am saying it as someone who never never needed to use Serde `remote` and I have not consulted with the Serde docs before making this comment. So, maybe it is clear enough for people trying to use this attribute.



##########
avro_derive/tests/serde.rs:
##########
@@ -370,6 +370,74 @@ mod container_attributes {
             a: vec!["spam".to_string()],
         });
     }
+
+    #[test]
+    fn avro_rs_562_remote() {

Review Comment:
   ```suggestion
       fn avro_rs_564_remote() {
   ```



-- 
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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Enable `#[serde(remote = "..")]` support [avro-rs]

Posted by "Kriskras99 (via GitHub)" <gi...@apache.org>.
Kriskras99 merged PR #564:
URL: https://github.com/apache/avro-rs/pull/564


-- 
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: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org