Typify - Compile JSON Schema documents into Rust types.

Related tags

Encoding JSON typify
Overview

Typify

Compile JSON Schema documents into Rust types. This can be used ...

  • via the macro import_types!("types.json") to generate Rust types directly in your program

  • via the builder functions to generate Rust types in build.rs

  • or via the builder functions to generate persistent files e.g. when building API bindings.

WIP

This is a work in progress. Here are some clear TODOs:

  • The API needs some consideration; the pieces are there, but it could stand being refined.

  • Strings with patterns and max/min lengths aren't carefully considering ATM

Just to not be overwhelmed, but what's not done: there's a lot that's neat!

  • Versions of schemars has a behavior (bug?) whereby it spits out enums as anyOf rather than oneOf; we detect when all subschemas are mutually incompatible so that we can treat these as enums.

  • All serde enum tagging types are supported.

  • Complex tuples are properly handled.

  • The test harness is pretty robust, validating that the generated TokenStream roughly matches the TokenStream of the original item (enum/struct/type).

Comments
  • defaults

    defaults

    I notice that the generated code for schemas with defaults provides serde attributes such as default::default_i64<...>() Is it intended that the user of code-generation produce those default functions? It's easy enough to do. I was just wondering if you had a library in mind.

    opened by rrichardson 6
  • cannot convert type string with format i64

    cannot convert type string with format i64

    When we have a property with some field like so:

            "properties": {
              "iterations": {
                "format": "int64",
                "type": "string"
              },
    

    Typify crashes with a panic

    Caused by:
      process didn't exit successfully: `/Users/<redacted>/projects/<redacted>/crates/target/debug/build/<redacted>-631c4662e317d757/build-script-build` (exit status: 101)
      --- stderr
      thread 'main' panicked at 'not yet implemented: Some(
          "int64",
      )', /Users/<redacted>/.cargo/git/checkouts/typify-288d5a84bbbe6a46/b712fe6/typify-impl/src/convert.rs:418:26
      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    opened by tzilist 4
  • Add support for rust_decimal

    Add support for rust_decimal

    Hey everyone, I encountered an openapi spec with a decimal format (primarily for currency type amounts) and figured this would be a reasonable addition to the library. This change adds support for rust_decimal to typify, inspired by the chrono support. Let me know if you have any objections/feedback to this and I'd be happy to address.

    By the way, great work on progenitor and this library. I'm really liking the direction these are heading and hoping I can make use of these in the future.

    This is the openapi spec in question: https://raw.githubusercontent.com/alpacahq/alpaca-docs/master/oas/broker/openapi.yaml

    opened by ryanahall 3
  • Bump uuid from 0.8.2 to 1.0.0

    Bump uuid from 0.8.2 to 1.0.0

    Bumps uuid from 0.8.2 to 1.0.0.

    Release notes

    Sourced from uuid's releases.

    1.0.0

    This release includes a huge amount of work from a lot of contributors. These notes are duplicated from 1.0.0-alpha.1 since they're relevant for anybody moving from 0.8.2 to 1.0.0.

    Changes since the last release

    https://github.com/uuid-rs/uuid/compare/0.8.2...main

    Contributions since the last release

    ... (truncated)

    Commits
    • 9e0dc29 Merge pull request #596 from KodrAus/cargo/1.0.0
    • 286134f prepare for 1.0.0 release
    • 43905eb Merge pull request #595 from spruceid/remove-and
    • 444ef96 Remove unnecessary AND
    • 5f649d7 Merge pull request #592 from uuid-rs/KodrAus-patch-1
    • 92ad25f update contact details in the CoC
    • 767f519 Merge pull request #591 from uuid-rs/fix/macro-diagnostics
    • 8b043af use the parsed literal as the span source for errors
    • f0d5956 Merge pull request #587 from uuid-rs/feat/fast-sha1
    • 165b7eb move to sha1_smol as the new name for the current library
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • Box trivial cyclic refs

    Box trivial cyclic refs

    If a struct A has a property that refers to type A, then insert a Box for this. Note that this commit only checks for these trivial cyclic refs.

    Saw "anyOf" for Option, so match against that case

    opened by jmpesp 2
  • test fail

    test fail

    • rustc 1.59.0-nightly (efec54529 2021-12-04)
    • fresh clone
    • cargo test (stable or nightly) :
    running 0 tests
    
    test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
    
         Running unittests (target/debug/deps/typify_impl-9179ec6858f40f9a)
    
    running 44 tests
    test convert::tests::test_int_i8 ... ok
    test convert::tests::test_int_i16 ... ok
    test convert::tests::test_int_i64 ... ok
    test convert::tests::test_int_i32 ... ok
    test convert::tests::test_int_nonzerou32 ... ok
    test convert::tests::test_int_nonzerou16 ... ok
    test convert::tests::test_int_nonzerou8 ... ok
    test convert::tests::test_int_u16 ... ok
    test convert::tests::test_int_u64 ... ok
    test convert::tests::test_int_nonzerou64 ... ok
    test convert::tests::test_int_u32 ... ok
    test convert::tests::test_set ... ignored
    test convert::tests::test_int_u8 ... ok
    test convert::tests::test_redundant_types ... ok
    test enums::tests::test_adjacently_tagged_enum ... ok
    test enums::tests::test_enum_detection_untagged ... ok
    test enums::tests::test_externally_tagged_enum ... ok
    test enums::tests::test_adjacently_tagged_enum_output ... ok
    test enums::tests::test_externally_tagged_enum_output ... ok
    test enums::tests::test_internally_tagged_enum ... ok
    test enums::tests::test_internal_deny_simple ... ok
    test enums::tests::test_result ... ok
    test enums::tests::test_maybe_option_as_enum ... ok
    test enums::tests::test_head_fake_tagged_enum ... ok
    test enums::tests::test_internally_tagged_enum_output ... ok
    test enums::tests::test_untagged_enum ... ok
    test enums::tests::test_simple_untagged_enum ... ok
    test structs::tests::test_less_simple_struct ... ok
    test structs::tests::test_object_no_validation ... ok
    test enums::tests::test_untagged_enum_output ... ok
    test structs::tests::test_simple_struct ... ok
    test tests::test_convert_enum_string ... ok
    test tests::test_alias ... ok
    test structs::tests::test_some_maps ... ok
    test tests::test_string_enum_with_null ... ok
    test type_entry::tests::test_ident ... ok
    test util::tests::test_exclusive_one_empty_struct ... ok
    test util::tests::test_exclusive_simple_arrays ... ok
    test util::tests::test_exclusive_structs ... ok
    test util::tests::test_non_exclusive_structs ... ok
    test util::tests::test_sanitize ... ok
    test tests::test_simple ... ok
    test util::tests::test_unique_prop_structs ... ok
    test structs::tests::test_flatten_stuff ... FAILED
    
    failures:
    
    ---- structs::tests::test_flatten_stuff stdout ----
    RootSchema {
        meta_schema: Some(
            "http://json-schema.org/draft-07/schema#",
        ),
        schema: SchemaObject {
            metadata: Some(
                Metadata {
                    id: None,
                    title: Some(
                        "FlattenStuff",
                    ),
                    description: None,
                    default: None,
                    deprecated: false,
                    read_only: false,
                    write_only: false,
                    examples: [],
                },
            ),
            instance_type: Some(
                Single(
                    Object,
                ),
            ),
            format: None,
            enum_values: None,
            const_value: None,
            subschemas: None,
            number: None,
            string: None,
            array: None,
            object: Some(
                ObjectValidation {
                    max_properties: None,
                    min_properties: None,
                    required: {
                        "number",
                    },
                    properties: {
                        "number": Object(
                            SchemaObject {
                                metadata: None,
                                instance_type: Some(
                                    Single(
                                        Integer,
                                    ),
                                ),
                                format: Some(
                                    "int32",
                                ),
                                enum_values: None,
                                const_value: None,
                                subschemas: None,
                                number: None,
                                string: None,
                                array: None,
                                object: None,
                                reference: None,
                                extensions: {},
                            },
                        ),
                    },
                    pattern_properties: {},
                    additional_properties: None,
                    property_names: None,
                },
            ),
            reference: None,
            extensions: {},
        },
        definitions: {},
    }
    #[derive(Serialize, Deserialize, Debug, Clone)]
    pub struct FlattenStuff {
        pub number: i32,
    }
    
    thread 'structs::tests::test_flatten_stuff' panicked at 'lengths don't match: 2 != 1', typify-impl/src/structs.rs:460:9
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    
    failures:
        structs::tests::test_flatten_stuff
    
    test result: FAILED. 42 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.09s
    
    error: test failed, to rerun pass '-p typify-impl --lib'
    
    opened by AlbanMinassian 2
  • Add a simple example that shows how to use the generated types

    Add a simple example that shows how to use the generated types

    The example-macro sub-project imports an example.json that provides a good use case to start with. The main.rs just had import_types! invocation which will generate the rust type. This PR adds on to that by showing how the generated types can be used.

    This more of a documentation PR than an actual bug. This fixes #14

    opened by benignbala 2
  • Bump serde_json from 1.0.82 to 1.0.83

    Bump serde_json from 1.0.82 to 1.0.83

    Bumps serde_json from 1.0.82 to 1.0.83.

    Release notes

    Sourced from serde_json's releases.

    v1.0.83

    • Add categories to crates.io metadata
    Commits
    • 2b0403f Release 1.0.83
    • db96d72 Add categories to crates.io metadata
    • 2512933 Add authors to Cargo.toml
    • 22da797 Sort package entries in Cargo.toml
    • 01ef46e Ignore assertions_on_result_states clippy lint
    • aac479a Avoid cargo 1.43–1.45 in GitHub Actions
    • 1a43381 Convert i/u128 conversion to itoa instead of std::fmt
    • 84c157b Directly install aarch64-unknown-none target support
    • d1cbbb6 Update ui test suite to nightly-2022-07-20
    • 5b441a2 Ignore explicit_auto_deref clippy lint
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Bump proc-macro2 from 1.0.43 to 1.0.44

    Bump proc-macro2 from 1.0.43 to 1.0.44

    Bumps proc-macro2 from 1.0.43 to 1.0.44.

    Release notes

    Sourced from proc-macro2's releases.

    1.0.44

    • Expose span.before() and span.after() to access an empty Span located immediately before or after the input span (#348, upstream tracking issue: rust-lang/rust#87552)
    Commits
    • 8f4fd2c Release 1.0.44
    • d531452 Add a sponsors link
    • c0592e3 Merge pull request #348 from dtolnay/beforeafter
    • cc97264 Expose proc_macro's before() and after() methods on Span
    • 648e2d8 Remove default package.readme metadata from Cargo.toml
    • a9fcdc0 GitHub Workflows security hardening
    • c946dfe Update ui test suite to nightly-2022-08-23
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump serde from 1.0.144 to 1.0.145

    Bump serde from 1.0.144 to 1.0.145

    Bumps serde from 1.0.144 to 1.0.145.

    Release notes

    Sourced from serde's releases.

    v1.0.145

    • Allow RefCell<T>, Mutex<T>, and RwLock<T> to be serialized regardless of whether T is Sized (#2282, thanks @​ChayimFriedman2)
    Commits
    • 8c036ee Release 1.0.145
    • d99009f Merge pull request #2282 from ChayimFriedman2/sized-mutex-refcell-rwlock
    • be3c37e Serialize unsized RefCell, Mutex and RwLock
    • f0346ae Merge pull request #2281 from dtolnay/try
    • fa6ce42 Redefine 'try' macro to omit From::from error conversion
    • a9320db Consistently avoid '?' throughout serde crate
    • d208762 Command-line ignore let_underscore_drop clippy lint
    • 5386897 Merge pull request #2273 from sashashura/patch-1
    • 68eb59d Update ci.yml
    • a7f4551 Add dev-dependencies keyword for serde_test
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump thiserror from 1.0.35 to 1.0.36

    Bump thiserror from 1.0.35 to 1.0.36

    Bumps thiserror from 1.0.35 to 1.0.36.

    Release notes

    Sourced from thiserror's releases.

    1.0.36

    Commits
    • 7b226e3 Release 1.0.36
    • f062061 Copy docs on struct error(transparent) into readme
    • 5271eb3 Touch up PR 195
    • 8e8e41d Merge pull request #195 from matklad/error-transparent
    • c79b023 Update ui test suite to nightly-2022-09-25
    • 765cd2a document that error(transparent) works with structs
    • b37dc36 Raise minimum tested toolchain to rust 1.56
    • 31dfd4c Remove default package.readme metadata from Cargo.toml
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Support telling serde where it is, i.e. when re-exported as a transitive dependency.

    Support telling serde where it is, i.e. when re-exported as a transitive dependency.

    Supported by the serde() annotation in derive macros, which otherwise will assume that serde is a direct crate dependency. When a macro emits a type that derives Serialize/Deserialize, the user of that macro would normally have to directly depend on serde themselves for the resulting expansion of those derive macros. This can be cumbersome when consuming serde transitively via some other crate (i.e. progenitor).

    https://github.com/serde-rs/serde/blob/5a8dcac2ed1407fab3f7fd23f2d56af42dcd448f/serde_derive/src/internals/attr.rs#L556-L561

    opened by lifning 3
  • adding support for seconds duration and human readable durations

    adding support for seconds duration and human readable durations

    This attempts to solve #61 in a simple way. It treats type: integer, format: seconds as an integer, and it also provides a default_fn implementation for human readable durations into seconds.

    opened by rrichardson 0
  • Support seconds/duration format

    Support seconds/duration format

    I have found a couple OApi Schemas out in the wild, (both from Golang shops) that use a type that is integer with a format of seconds .
    The expected value is a human readable duration, e.g. 24h

    So this would imply that they're expecting a duration type which can be set by human readable values, that evaluates to, well, seconds.

    The API itself expects either the number of seconds as an integer, or a human readble duration string, e.g. 24h I'm fine with treating seconds as a uint64. Thoughts?

    Presently, typify just fails with a type error when it encounters this scenario. So at the very least, defaulting to whatever is the "default" for integer would be preferred.

    opened by rrichardson 0
  • Allow configuration of package dependencies and format types

    Allow configuration of package dependencies and format types

    Currently, typify can generate code that depends on uuid and chrono. It might be useful to enable support for other packages or it might be useful to deny use, say, of uuid and represent a { "type": "string", "format": "uuid" } as a String rather than as an uuid::Uuid. One could even imagine allowing substitutes for the std types for arrays, maps, and sets.

    In addition, it could be useful to allow consumers to specify new associations between formats and Rust types or to override existing ones. For example, a user might want to use rust_decimal::Decimal" for the "decimal" format orchrono::naive::NaiveDatefor the "date" format (rather thanchrono::Date`).

    We could modify the macro, builder, and command-line interfaces to allow this (perhaps all through a shared Settings type). e.g.

    import_types!(
        schema = "../example.json",
        allow_packages = [uuid, chrono],
        additional_string_formats = {
            "decimal" = "rust_decimal::Decimal",
            "date" = "chrono::naive::naiveDate",
        },
    );
    
    opened by ahl 0
  • handling for arbitrary containment and derive cycles

    handling for arbitrary containment and derive cycles

    JSON Schema can define types that have cycles. This is simple to handle in languages like JavaScript or Java, but more complex in Rust since those cycles must be explicitly broken with a Box<T>. Note that use of a Vec or HashMap also breaks the containment cycle but has implications for derive computation which we will discuss later. Note too that where one "breaks" a cycle may have multiple solutions, some that require more breaks than others. Note also that it may not be feasible to reconstruct the types e.g. if the JSON Schema were derived from Rust types because the information about Box indirections is explicitly discarded (and probably reasonably so, but one could imagine including hints; more on that later as well).

    Currently we break trivial A -> A cycles such as:

    struct A {
        a: Option<Box<A>>, // this needs to be boxed
    }
    

    We can do this without a bunch of graph traversal and it solved a proximate problem.

    The more general case requires us to decompose the type graph into strongly connected subgraphs that form a DAG (e.g. with algorithms proposed by Tarjan, Dijkstra or Kosaraju). In this case, the edges are defined by structure or newtype containment either directly or via an Option type. Within each strongly connected subgraph we then would determine where to "break" the cycles by inserting Boxes. The general case of this requires exponential time to compute. While the number of nodes (types) in a cycle is likely to be small, we still may elect for a heuristic, the simplest of which would be to cut all edges. There's very little harm in cutting more than is absolutely required--the serialization isn't affected for example--the only consequence is to the legibility and ergonomics of the generated types.

    For JSON Schema generated from rust types, it could be helpful to annotate boxed types with an extension. This could act as a heuristic when slicing a strongly connected component i.e. we use these extensions to see if they properly break the containment cycle and do something else if they don't.


    The derive macros we apply to types have a similar problem. Consider, for example, the following type:

    struct A {
        value: u32,
    }
    

    For this struct we could #[derive(Eq, PartialEq)], but if we change the u32 to an f32 we could not! A Vec<T> is Eq only if T: Eq and a HashSet<T> isn't Ord regardless of the traits implemented by T.

    From the list of desirable traits to implement such as Hash, Ord, and Eq, the ones we can apply to a type depend on the types to which it refers. And those references may form a cycle. As above, we must compute the strongly connected components. Above the edges were containment; here the edges are all references (i.e. a Vec is an edge here but not above`). Within each strongly connected component we must take the intersection of all supportable traits.

    opened by ahl 0
Owner
Oxide Computer Company
Servers as they should be.
Oxide Computer Company
JSON Schema validation library

A JSON Schema validator implementation. It compiles schema into a validation tree to have validation as fast as possible.

Dmitry Dygalo 279 Sep 21, 2022
Get JSON values quickly - JSON parser for Rust

get json values quickly GJSON is a Rust crate that provides a fast and simple way to get values from a json document. It has features such as one line

Josh Baker 153 Sep 30, 2022
A rust script to convert a better bibtex json file from Zotero into nice organised notes in Obsidian

Zotero to Obsidian script This is a script that takes a better bibtex JSON file exported by Zotero and generates an organised collection of reference

Sashin Exists 2 Feb 12, 2022
CLI tool to convert HOCON into valid JSON or YAML written in Rust.

{hocon:vert} CLI Tool to convert HOCON into valid JSON or YAML. Under normal circumstances this is mostly not needed because hocon configs are parsed

Mathias Oertel 21 Sep 17, 2022
Decode Metaplex mint account metadata into a JSON file.

Simple Metaplex Decoder (WIP) Install From Source Install Rust. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh Clone the source: git c

Samuel Vanderwaal 8 Aug 25, 2022
Serialize/Deserialize tch-rs types with serde

tch-serde: Serialize/Deserialize tch-rs types with serde This crate provides {ser,de}ialization methods for tch-rs common types. docs.rs | crates.io U

null 4 Apr 3, 2022
JSON parser which picks up values directly without performing tokenization in Rust

Pikkr JSON parser which picks up values directly without performing tokenization in Rust Abstract Pikkr is a JSON parser which picks up values directl

Pikkr 609 Sep 16, 2022
Strongly typed JSON library for Rust

Serde JSON   Serde is a framework for serializing and deserializing Rust data structures efficiently and generically. [dependencies] serde_json = "1.0

null 3.3k Sep 29, 2022
JSON implementation in Rust

json-rust Parse and serialize JSON with ease. Changelog - Complete Documentation - Cargo - Repository Why? JSON is a very loose format where anything

Maciej Hirsz 489 Sep 25, 2022
Rust port of gjson,get JSON value by dotpath syntax

A-JSON Read JSON values quickly - Rust JSON Parser change name to AJSON, see issue Inspiration comes from gjson in golang Installation Add it to your

Chen Jiaju 86 Sep 4, 2022
A easy and declarative way to test JSON input in Rust.

assert_json A easy and declarative way to test JSON input in Rust. assert_json is a Rust macro heavily inspired by serde json macro. Instead of creati

Charles Vandevoorde 9 Nov 30, 2021
A small rust database that uses json in memory.

Tiny Query Database (TQDB) TQDB is a small library for creating a query-able database that is encoded with json. The library is well tested (~96.30% c

Kace Cottam 2 Jan 4, 2022
A JSON Query Language CLI tool built with Rust 🦀

JQL A JSON Query Language CLI tool built with Rust ?? ?? Core philosophy ?? Stay lightweight ?? Keep its features as simple as possible ?? Avoid redun

Davy Duperron 826 Sep 25, 2022
rurl is like curl but with a json configuration file per request

rurl rurl is a curl-like cli tool made in rust, the difference is that it takes its params from a json file so you can have all different requests sav

Bruno Ribeiro da Silva 6 Sep 10, 2022
A tool for outputs semantic difference of json

jsondiff A tool for outputs semantic difference of json. "semantic" means: sort object key before comparison sort array before comparison (optional, b

niboshi 3 Sep 22, 2021
Easily create dynamic css using json notation

jss! This crate provides an easy way to write dynamic css using json notation. This gives you more convenient than you think. Considering using a dyna

Jovansonlee Cesar 7 May 14, 2022
A fast and simple command-line tool for common operations over JSON-lines files

rjp: Rapid JSON-lines processor A fast and simple command-line tool for common operations over JSON-lines files, such as: converting to and from text

Ales Tamchyna 3 Jul 8, 2022
Tools for working with Twitter JSON data

Twitter stream user info extractor This project lets you parse JSON data from the Twitter API or other sources to extract some basic user information,

Travis Brown 4 Apr 21, 2022
A fast way to minify JSON

COMPACTO (work in progress) A fast way to minify JSON. Usage/Examples # Compress # Input example (~0.11 KB) # { # "id": "123", # "name": "Edua

Eduardo Stuart 4 Feb 27, 2022