
The major change in schemars 1.0 is that now schemas are represented as plain json values instead of specialized datatypes. This allows for more concise construction and manipulation. This change also improves how settings schemas are generated. Each top level settings type was being generated as a full root schema including the definitions it references, and then these were merged. This meant generating all shared definitions multiple times, and might have bugs in cases where there are two types with the same names. Now instead the schemar generator's `definitions` are built up as they normally are and the `Settings` trait no longer has a special `json_schema` method. To handle types that have schema that vary at runtime (`FontFamilyName`, `ThemeName`, etc), values of `ParameterizedJsonSchema` are collected by `inventory`, and the schema definitions for these types are replaced. To help check that this doesn't break anything, I tried to minimize the overall [schema diff](https://gist.github.com/mgsloan/1de549def20399d6f37943a3c1583ee7) with some patches to make the order more consistent + schemas also sorted with `jq -S .`. A skim of the diff shows that the diffs come from: * `enum: ["value"]` turning into `const: "value"` * Differences in handling of newlines for "description" * Schemas for generic types no longer including the parameter name, now all disambiguation is with numeric suffixes * Enums now using `oneOf` instead of `anyOf`. Release Notes: - N/A
48 lines
1.2 KiB
TOML
48 lines
1.2 KiB
TOML
[package]
|
|
name = "theme"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
publish.workspace = true
|
|
license = "GPL-3.0-or-later"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[features]
|
|
default = []
|
|
test-support = ["gpui/test-support", "fs/test-support", "settings/test-support"]
|
|
|
|
[lib]
|
|
path = "src/theme.rs"
|
|
doctest = false
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
collections.workspace = true
|
|
derive_more.workspace = true
|
|
fs.workspace = true
|
|
futures.workspace = true
|
|
gpui.workspace = true
|
|
indexmap.workspace = true
|
|
inventory.workspace = true
|
|
log.workspace = true
|
|
palette = { workspace = true, default-features = false, features = ["std"] }
|
|
parking_lot.workspace = true
|
|
refineable.workspace = true
|
|
schemars = { workspace = true, features = ["indexmap2"] }
|
|
serde.workspace = true
|
|
serde_derive.workspace = true
|
|
serde_json.workspace = true
|
|
serde_json_lenient.workspace = true
|
|
serde_repr.workspace = true
|
|
settings.workspace = true
|
|
strum.workspace = true
|
|
thiserror.workspace = true
|
|
util.workspace = true
|
|
uuid.workspace = true
|
|
workspace-hack.workspace = true
|
|
|
|
[dev-dependencies]
|
|
fs = { workspace = true, features = ["test-support"] }
|
|
gpui = { workspace = true, features = ["test-support"] }
|
|
settings = { workspace = true, features = ["test-support"] }
|