Skip to content
Discussion options

You must be logged in to vote

Self-correction after re-reading src/config.rs. Two corrections to my previous reply:

  1. Config is NOT marked deny_unknown_fields. Current derive is just #[derive(Debug, Default, Deserialize)] (no Serialize, no deny_unknown_fields). My comment "make sure to keep deny_unknown_fields when you add JsonSchema" was wrong — there is none to keep, and the derived schema will reflect whatever the deserializer actually accepts (which today is permissive — unknown keys are silently dropped).

  2. Config is re-exported from the crate root, so the derive lives on the re-exported type, not on tokei::config::Config:

    // src/lib.rs
    pub use self::{ config::Config, /* ... */ };

    That doesn't change the answer (…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Freed-Wu
Comment options

Answer selected by Freed-Wu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants