Skip to content

json-schema-tools/meta-schema

Folders and files

NameName
Last commit message
Last commit date
Apr 11, 2024
Apr 29, 2021
Jan 28, 2020
May 7, 2024
Jun 24, 2021
Jan 28, 2020
Jun 24, 2021
Apr 11, 2024
Oct 4, 2022
Oct 7, 2020
May 7, 2024
Jan 28, 2020
Jan 28, 2020
Oct 4, 2022
May 7, 2024
Jan 28, 2020
Jun 24, 2021
Jan 28, 2020
Jan 28, 2020
Jun 18, 2021
May 7, 2024
Jun 18, 2021
May 7, 2024
Oct 23, 2024
Jul 29, 2024
Jun 18, 2021

Repository files navigation

JSON Schema Meta Schema

This repo contains the json schema meta schema and code to package it on npm, generate typings, etc.

Installing

Typescript

npm install --save @json-schema-tools/meta-schema

Golang

go get github.com/json-schema-tools/meta-schema

Rust

cargo install json_schema

Using

Typescript

import JSONSchema, { JSONSchemaObject, Properties, Items } from "@json-schema-tools/meta-schema"

Rust

From a string

let foo = r#"{
    "title": "helloworld",
    "type": "string"
}"#;

let as_json_schema: JSONSchemaObject = serde_json::from_str(foo).unwrap();

Using builder pattern

let schema = JSONSchemaObjectBuilder::default()
    .title("foobar".to_string())
    ._type(Type::SimpleTypes(SimpleTypes::String))
    .build()
    .unwrap();

let as_str = serde_json::to_string(&schema).unwrap();

Contributing

How to contribute, build and release are outlined in CONTRIBUTING.md, BUILDING.md and RELEASING.md respectively. Commits in this repository follow the CONVENTIONAL_COMMITS.md specification.