Skip to content

Conversation

oguzkocer
Copy link
Contributor

Replace manual *ListParamsField enum implementations with a procedural macro that automatically generates field enums from struct definitions. The macro generates enums with:

  • Automatic PascalCase conversion for variant names
  • Support for #[field_name("custom_name")] attribute for custom serialization names
  • Strum attributes for field serialization

@oguzkocer oguzkocer added this to the 0.2 milestone Sep 3, 2025
@oguzkocer oguzkocer added the Rust label Sep 3, 2025
Base automatically changed from refactor/wp-content-id-macros to trunk September 10, 2025 18:44
Replace manual *ListParamsField enum implementations with a procedural macro
that automatically generates field enums from struct definitions.

The macro generates enums with:
- Automatic PascalCase conversion for variant names
- Support for #[field_name("custom_name")] attribute for custom serialization names
- Proper strum attributes for field serialization

Changes:
- Add wp_derive::WpDeriveParamsField procedural macro in params_field.rs
- Replace manual enum implementations across 12 API parameter structs
- Remove redundant IntoStaticStr imports (now handled by macro)
- Add comprehensive test suite with pass/fail scenarios
- Update dependencies to include convert_case and strum_macros
@oguzkocer oguzkocer force-pushed the feature/wp-derive-params-field-macro branch from 9a8e80f to e00313a Compare September 10, 2025 18:45
@oguzkocer oguzkocer marked this pull request as ready for review September 10, 2025 18:45
@oguzkocer
Copy link
Contributor Author

Admin merging it as CI confirmed the changes before the rebase.

@oguzkocer oguzkocer merged commit d92e4d8 into trunk Sep 10, 2025
1 of 14 checks passed
@oguzkocer oguzkocer deleted the feature/wp-derive-params-field-macro branch September 10, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants