https://github.com/thepalbi/json-example-generator
Random JSON examples generator from go-like schema definition
https://github.com/thepalbi/json-example-generator
json lexer parser random
Last synced: 2 months ago
JSON representation
Random JSON examples generator from go-like schema definition
- Host: GitHub
- URL: https://github.com/thepalbi/json-example-generator
- Owner: thepalbi
- Created: 2019-06-29T23:37:15.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-06T01:55:33.000Z (almost 7 years ago)
- Last Synced: 2024-04-15T22:53:26.741Z (about 2 years ago)
- Topics: json, lexer, parser, random
- Language: Go
- Homepage:
- Size: 88.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Random JSON example generator
### Installation steps
This guide is assuming the OS used is linux-based, and build-essentials (gcc, etc.) is installed.
1- Install the go-environment. Here is a tutorial for reference, download links, and support links. https://golang.org/doc/install
2- Once installed, check in a terminal-emulator if go was correctly setuped:
- Run the command ```go version```, you should see your go installation version.
- Run echo ```echo $GOPATH```, you should see sth. like ```~/some_username/go```.
3- Clone this repository, by using the ```go get github.com/plbalbi/json-example-generator``` command.
4- Go into the cloned-project directory. This should do it ```cd $HOME/go/src/github.com/plbalbi/json-example-generator```.
5- Run the installation script ```./install.sh```. This will download the project go dependencies, and compile the parser.
6- Run the tests to check evrything is working: ```go test ./...```.
7- Compile the binary, and use it: ```go build```.
Tool that generates random JSON examples, with a structure defined in a subset of GoLang struct syntax.
## Tooling
So far, the tooling that will be used is:
- GoYacc: https://about.sourcegraph.com/go/gophercon-2018-how-to-write-a-parser-in-go
- A build by hand Lexer, inspired in https://www.youtube.com/watch?v=HxaD_trXwRE