elad-yosifon opened a new issue, #226:
URL: https://github.com/apache/avro-rs/issues/226

   #### Code Example:
   ```rust
   struct X {
     #[serde(skip_serializing_if = "Option::is_none")]
     y: Option<String>,
     z: Option<i8>
   }
   
   ```
   
   #### Issue Description:
   while trying to serialize an instance such as `X { y: None, z: Some(0)}` 
using `Writer::append_ser(..)`, it panics with an index-out-of-bounds error 
pointing to: 
[#/src/ser_schema.rs:376:45](https://github.com/apache/avro-rs/blob/d8bc430148a0f160334a9b5ee661178f4e701892/avro/src/ser_schema.rs#L376)
   
   
   #### RCA:
   * Serde allows for field skipping using the `skip_serializing_if` directive.
   * current implementation assumes that schema field count matchs the number 
of `serializer.serialize(..)` calls 100%.
   * Use of unsafe random-access on a vec, panics when the assumption breaks.
   


-- 
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