mirror of
https://github.com/leptos-rs/leptos
synced 2024-09-20 06:21:57 +00:00
c755dae6ee
Currently, `leptos::LeptosOptions` are deserialized (and serialized) to `snake_case`, since, by default, `serde` uses the name of the field as-is. The options given via `.toml` files are given using `kebab-case`. This behaviour leads to problems if you wish to use `leptos::LeptosOptions` as the type of a field in your own config, which uses the `kebab-case` syntax, as it will not provide any values to that field. These changes switch out the previous mechanism of manually replacing the `-` character to the `_` character in order for serialization to work. In its place, it uses `serde`'s `#[serde(rename_all = ...)]` macro to handle the naming convention. In case other naming conventions are used, a workaround would be to define a user-owned mirror struct of `leptos::LeptosOptions`, which would contain the required fields, deserialize it as desired and' convert it to the latter via, for example, the `From<T>` trait. Closes: #1295 Signed-off-by: Filip Dutescu <filip@hucksy.dev> |
||
---|---|---|
.. | ||
src | ||
tests | ||
Cargo.toml |