specta-jsonschema 0.0.3 loses information from the source specta::DataType in three places:
-
Primitives (String, i32, bool, …) are emitted as $ref to a definition with an empty body {}. A consumer can't tell a String field from one of unknown type.
-
Generic parameters are stripped. A Vec<T> field becomes a $ref to a Vec definition that is also {} — the element type is gone.
-
/// doc comments on struct fields are not emitted as description. Only the root-schema description (set via the builder) makes it into the output.
specta-typescript renders the same DataType tree correctly — primitives become string / number / boolean, Vec<T> becomes T[], and doc comments turn into JSDoc — so the information exists in specta; it just isn't carried into the JSON Schema output.
#ref
specta-jsonschema0.0.3 loses information from the sourcespecta::DataTypein three places:Primitives (
String,i32,bool, …) are emitted as$refto a definition with an empty body{}. A consumer can't tell aStringfield from one of unknown type.Generic parameters are stripped. A
Vec<T>field becomes a$refto aVecdefinition that is also{}— the element type is gone.///doc comments on struct fields are not emitted asdescription. Only the root-schema description (set via the builder) makes it into the output.specta-typescriptrenders the sameDataTypetree correctly — primitives becomestring/number/boolean,Vec<T>becomesT[], and doc comments turn into JSDoc — so the information exists inspecta; it just isn't carried into the JSON Schema output.#ref