Skip to content

Conversation

@Kriskras99
Copy link
Contributor

@Kriskras99 Kriskras99 commented Dec 23, 2025

This PR changes the attribute parsing in #[derive(AvroSchema)] to also use the Serde attributes.
It will use the Serde attributes and check that they match the Avro attributes if provided. It will
also check that known incompatible Serde attributes result in a compile error instead of a runtime panic.

Testing for the compile errors is done using trybuild. These tests run only on nightly as the output can vary between compiler versions (otherwise MSRV and latest stable could have different outputs and break the entire CI).

The large amount of changes in avro_derive/tests/derive.rs is because I removed the unnecessary test module, which changed the indentation of every line.

@Kriskras99 Kriskras99 changed the title feat: Use the Serde attributes and check for conflicting attributes Draft: feat: Use the Serde attributes and check for conflicting attributes Dec 23, 2025
@Kriskras99 Kriskras99 force-pushed the feat/use_serde_attributes branch from fad2499 to 9c7a490 Compare December 23, 2025 12:49
@Kriskras99 Kriskras99 changed the title Draft: feat: Use the Serde attributes and check for conflicting attributes feat: Use the Serde attributes and check for conflicting attributes Dec 23, 2025
@Kriskras99 Kriskras99 force-pushed the feat/use_serde_attributes branch from 9c7a490 to 2f02fa0 Compare December 23, 2025 13:16
This commit changes the attribute parsing in `#[derive(AvroSchema)]` to also use the Serde attributes.
It will use the Serde attributes and check that they match the Avro attributes if provided. It will
also check that known incompatible Serde attributes result in a compile error instead of a runtime panic.

Testing for the compile errors is done using `trybuild`. These tests run only on nightly as the output
can vary between compiler versions (otherwise MSRV and latest stable could have different outputs and break the entire CI).
@Kriskras99 Kriskras99 force-pushed the feat/use_serde_attributes branch from 2f02fa0 to 0ed7a90 Compare December 24, 2025 17:41
@Kriskras99 Kriskras99 changed the base branch from main to chore/remove_unnecessary_mod December 24, 2025 17:41
@Kriskras99
Copy link
Contributor Author

I've moved the indentation change to a separate PR (#375) to make this easier to review.

@Kriskras99 Kriskras99 requested a review from martin-g December 24, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant