Skip to content

Commit 60cb034

Browse files
authored
Merge pull request #100 from sine-fdn/random-data-gen
Random data gen
2 parents 6190269 + a1b92ec commit 60cb034

10 files changed

+1218
-47
lines changed

gen/Cargo.lock

+42-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ serde_json = "1.0.96"
1414
rust_decimal = "1.35.0"
1515
rust_decimal_macros = "^1.20"
1616
regex = "1.10.4"
17+
quickcheck = "1"
18+
quickcheck_macros = "1"
1719
uuid = { version = "1.8", features = ["v4", "serde"] }

gen/schemas/hoc.json

+24-8
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,13 @@
135135
]
136136
},
137137
"energyConsumptionUnit": {
138-
"type": [
139-
"string",
140-
"null"
138+
"anyOf": [
139+
{
140+
"$ref": "#/definitions/EnergyConsumptionUnit"
141+
},
142+
{
143+
"type": "null"
144+
}
141145
]
142146
},
143147
"feedstocks": {
@@ -168,6 +172,15 @@
168172
"Electric"
169173
]
170174
},
175+
"EnergyConsumptionUnit": {
176+
"type": "string",
177+
"enum": [
178+
"l",
179+
"kg",
180+
"kWh",
181+
"MJ"
182+
]
183+
},
171184
"Feedstock": {
172185
"type": "object",
173186
"required": [
@@ -178,11 +191,14 @@
178191
"$ref": "#/definitions/FeedstockType"
179192
},
180193
"feedstockPercentage": {
181-
"type": [
182-
"number",
183-
"null"
184-
],
185-
"format": "double"
194+
"anyOf": [
195+
{
196+
"$ref": "#/definitions/Decimal"
197+
},
198+
{
199+
"type": "null"
200+
}
201+
]
186202
},
187203
"regionProvenance": {
188204
"type": [

gen/schemas/tad.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,14 @@
126126
"$ref": "#/definitions/FeedstockType"
127127
},
128128
"feedstockPercentage": {
129-
"type": [
130-
"number",
131-
"null"
132-
],
133-
"format": "double"
129+
"anyOf": [
130+
{
131+
"$ref": "#/definitions/Decimal"
132+
},
133+
{
134+
"type": "null"
135+
}
136+
]
134137
},
135138
"regionProvenance": {
136139
"type": [

gen/schemas/toc.json

+24-8
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,13 @@
146146
]
147147
},
148148
"energyConsumptionUnit": {
149-
"type": [
150-
"string",
151-
"null"
149+
"anyOf": [
150+
{
151+
"$ref": "#/definitions/EnergyConsumptionUnit"
152+
},
153+
{
154+
"type": "null"
155+
}
152156
]
153157
},
154158
"feedstocks": {
@@ -179,6 +183,15 @@
179183
"Electric"
180184
]
181185
},
186+
"EnergyConsumptionUnit": {
187+
"type": "string",
188+
"enum": [
189+
"l",
190+
"kg",
191+
"kWh",
192+
"MJ"
193+
]
194+
},
182195
"Feedstock": {
183196
"type": "object",
184197
"required": [
@@ -189,11 +202,14 @@
189202
"$ref": "#/definitions/FeedstockType"
190203
},
191204
"feedstockPercentage": {
192-
"type": [
193-
"number",
194-
"null"
195-
],
196-
"format": "double"
205+
"anyOf": [
206+
{
207+
"$ref": "#/definitions/Decimal"
208+
},
209+
{
210+
"type": "null"
211+
}
212+
]
197213
},
198214
"regionProvenance": {
199215
"type": [

0 commit comments

Comments
 (0)