https://github.com/mohsen1/json-to-json-schema
Convert a JSON to a JSON Schema describing that JSON
https://github.com/mohsen1/json-to-json-schema
Last synced: 23 days ago
JSON representation
Convert a JSON to a JSON Schema describing that JSON
- Host: GitHub
- URL: https://github.com/mohsen1/json-to-json-schema
- Owner: mohsen1
- License: mit
- Created: 2015-10-28T23:39:07.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-28T20:06:10.000Z (about 8 years ago)
- Last Synced: 2025-03-18T12:47:28.655Z (27 days ago)
- Language: JavaScript
- Homepage:
- Size: 73.2 KB
- Stars: 33
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - mohsen1/json-to-json-schema - Convert a JSON to a JSON Schema describing that JSON (JavaScript)
README
# JSON to JSON Schema
[](https://travis-ci.org/mohsen1/json-to-json-schema)
> Convert a JSON to a JSON Schema describing that JSON
## Usage
```js
import {convert} from 'json-to-json-schema';const myJson = {name: 'Mohsen'};
const mySchema = convert(myJson);
console.log(mySchema); // => {type: 'object', properties: {name: {type: 'string'}}}
```## Installation
Use npm or Bower to install this package```
npm install --save json-to-json-schema
```
```
bower install --save json-to-json-schema
```
The browser module supports all UMD module systems. It exposes `JSONToJSONSchema` global object when there is no module system available.## Development
To install dependencies```
npm install
```To run tests
```
npm test
```To run tests continuously and watch for changes install [mocha](https://mochajs.org/) and run:
```
mocha --compilers js:babel/register -w
```To make a new browser build run
```
npm run browserify
```## License
[MIT](./LICENSE)