| Crates.io | schema_generator |
| lib.rs | schema_generator |
| version | 0.2.8 |
| created_at | 2025-01-08 01:45:08.485956+00 |
| updated_at | 2025-02-11 02:24:48.053307+00 |
| description | This crate is a part of the ClimateForest project, which takes place between 01.03.2024–28.02.2027. It is funded by Interreg Aurora and supported by its contributors, including Metsäkeskus, Lapland University of Applied Sciences, Luke luonnonvarakeskus, Luleå Tekniska Universitet, Skoggstyrelsen, and SLU. |
| homepage | |
| repository | https://github.com/mabackma/schema_generator |
| max_upload_size | |
| id | 1507995 |
| size | 10,841,333 |
schema_generator is a Rust crate initially created for parsing XML files containing forestry data and generating corresponding Rust structs. It parses XML documents and automatically generates Rust data structures that map XML elements to fields, including attributes, child elements, and text content. It integrates with the serde library for serialization and deserialization. While it was originally designed for forestry-related XML data, it can be used with any XML data structure, making it a versatile tool for developers working with XML. Additionally, schema_generator supports JSON to XML conversion.create_structs_and_save_to_file: creates structs from an XML String and saves them to a file into the /src folder, making the structs ready for use in an application. When use_primitives is set to true, numeric fields will have type Number (e.g. i64 or f64). When it is set to false, all fields will have String type.json_keys_to_lowercase: converts all keys in a serde_json value to lowercase. Additionally, it replaces all @ characters with __ to avoid unexpected behavior during JSON processing.json_to_xml: converts JSON data into XML format. Attribute keys in the JSON are expected to be marked with __.Option<String> even when use_primitives is set to true.