Skip to content
Crate for generating rust types from a json schema
Rust Shell
Branch: master
Clone or download
Marwes Merge pull request #26 from adeschamps/json-schema-test-suite
Enable more tests from the JSON schema test suite
Latest commit 0e6957a Nov 26, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
schemafy_core Update Cargo.toml with links Jul 7, 2019
src Enable more tests from the JSON schema test suite Nov 26, 2019
tests Add a binary target to generate tests from the test suite. Nov 16, 2019
.gitignore Don't regenerated the schema every time Jul 5, 2019
.gitmodules Add JSON Schema Test Suite submodule. Nov 16, 2019
.travis.yml Generate tests in travis. Nov 16, 2019
Cargo.toml Update syn, quote, proc-macro2 to versions 1.0. Nov 23, 2019
LICENSE docs: Add a README.md and LICENSE Oct 31, 2016
README.md Don't regenerated the schema every time Jul 5, 2019
publish.sh Update Cargo.toml with links Jul 7, 2019
version.sh

README.md

schemafy

Build Status Docs

This is a Rust crate which can take a JSON schema (draft 4) and generate Rust types which are serializable with serde. No checking such as min_value are done but instead only the structure of the schema is followed as closely as possible.

As a schema could be arbitrarily complex this crate makes no guarantee that it can generate good types or even any types at all for a given schema but the crate does manage to bootstrap itself which is kind of cool.

Example

Generated types for VS Codes debug server protocol: https://docs.rs/debugserver-types

Development

The types generated by the JSON schema specification can be regenerated with cargo build --features internal-regenerate if changes have been made in the library itself. Rustfmt is required so that src/schema.rs is readable.

You can’t perform that action at this time.