Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alessiosavi/gofakejson
Generate fake json data for the test input of a software, using an exhaustive permutation of the input data
https://github.com/alessiosavi/gofakejson
Last synced: about 6 hours ago
JSON representation
Generate fake json data for the test input of a software, using an exhaustive permutation of the input data
- Host: GitHub
- URL: https://github.com/alessiosavi/gofakejson
- Owner: alessiosavi
- License: apache-2.0
- Created: 2020-02-11T21:36:39.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-03T10:44:11.000Z (over 3 years ago)
- Last Synced: 2024-05-10T18:58:40.392Z (8 months ago)
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# GoFakeJson
Generate data for fake test json, using an exhaustive permutation of the input data
The scope of this tool is to generate some fake json data by a given data, using permutation.
The tool take three parameters:
- `-json`: path of the json file to take as template
- `-conf`: path of the data that have to be generated
- `-output`: folder created that will contains the dataThe `-json` parameter have to be the path of the json.
The `-conf` file is an `.ini` file that have to respect the following rules:- Nested data are separated with `dot` (.)
- Array index are expressed as `[index]`
- The data that have to be inserted have to be after the `=`, splitted by `,`## Example
Assume that we have the following JSON and we want to create some data changing the type of `eventName`
```json
{
"Records": [
{
"eventID": "f07f8ca4b0b26cb9c4e5e77e69f274ee",
"eventName": "INSERT",
"eventVersion": "1.1",
"eventSource": "aws:dynamodb",
"awsRegion": "us-east-1",
"userIdentity": {
"type": "Service",
"principalId": "dynamodb.amazonaws.com"
},
"dynamodb": {
"ApproximateCreationDateTime": 1480642020,
"Keys": {
"val": {
"S": "data"
},
"key": {
"S": "binary"
}
},
"NewImage": {
"val": {
"S": "data"
},
"asdf1": {
"B": "AAEqQQ=="
},
"asdf2": {
"BS": [
"AAEqQQ==",
"QSoBAA=="
]
},
"key": {
"S": "binary"
}
},
"SequenceNumber": "1405400000000002063282832",
"SizeBytes": 54,
"StreamViewType": "NEW_AND_OLD_IMAGES"
},
"eventSourceARN": "arn:aws:dynamodb:us-east-1:123456789012:table/Example-Table/stream/2016-12-01T00:00:00.000"
}
]
}
```The configuration file will be as following:
```ini
Records.[0].eventName=INSERT,REMOVE,MODIFY
```If we need to generate more data using different combination:
```ini
Records.[0].eventName=INSERT,REMOVE,MODIFY
Records.[0].dynamodb.NewImage.val.S=data,test,prova
```