juniper
juniper copied to clipboard
Add `arbitrary` support
This adds optional support for https://github.com/rust-fuzz/arbitrary/ behind
the arbitrary1
feature flag (off by default).
This will be used in a future pull request to enable fuzzing using cargo-fuzz
I haven't added this to CI yet. I'm also not sure we want these next to the definitions rather than in their own module...next to definitions makes the file noisy, but putting them in their own crate makes them further away from the type they are implementing on.
Note that I had to manually implement rather than use the Arbitrary
derive in many places due to lifetimes (see https://github.com/rust-fuzz/arbitrary/issues/104)
This isn't 100% yet because the arbitrary Name
implementation on Schema
causes an error of IncorrectFormat
all the time. That being said, this is a good start and allows everything to compile (minus the TODOs). I'm working on the custom arbitrary implementations that more closely match the expectations of the underlying data model.