Commit 60053a0
committed
fix(registry): drop Deserialize derive on structs with &'static fields
The generated `ParamDef`, `BodyDef`, and `OperationDef` derive both
`Serialize` and `Deserialize` but contain `&'static str` and
`&'static [ParamDef]` fields. `Deserialize` cannot reconstruct
references to baked-in static data, so consumers of the generated
`registry.rs` failed to compile with:
the trait bound `&'static [ParamDef]: serde::Deserialize<'de>`
is not satisfied
The data is only ever produced at codegen time and read at runtime,
so `Serialize`-only is the correct shape. Drop `Deserialize` from the
three relevant structs and add a docstring noting why.
Caught while wiring `enable_registry = true` for the virgil walking
skeleton's github-mini integration crate.1 parent 782ccf7 commit 60053a0
1 file changed
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
| |||
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
103 | | - | |
104 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
110 | 116 | | |
111 | | - | |
112 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
113 | 121 | | |
114 | 122 | | |
115 | 123 | | |
| |||
0 commit comments