{
	"definitions": {},
	"$schema": "http://json-schema.org/draft-07/schema#",
	"$id": "https://a2809calculator.snapplus.wisc.edu/JSONOutputSchema.json",
	"title": "Root",
	"type": "array",
	"default": [],
	"items":{
		"$id": "#root/items",
		"title": "Items",
		"type": "object",
		"required": [
			"labName",
			"labJobID",
			"county",
			"farmName",
			"fieldName",
			"soilSeries",
			"soilMapUnit",
			"scoopWeight",
			"plowDepth",
			"isIrrigated",
			"isDrained",
			"avgPH",
			"avgOM",
			"avgP",
			"avgK",
			"testInterpP",
			"testInterpK",
			"avgCa",
			"avgMg",
			"avgB",
			"avgMn",
			"avgZn",
			"avgS",
			"comments",
			"npkResults",
			"fieldLimeRecResult",
			"exceptionMessage",
			"innerExceptionMessage",
			"exceptionStackTrace"
		],
		"properties": {
			"labName": {
				"$id": "#root/items/labName",
				"title": "Lab name",
				"type": "string",
				"default": "",
				"examples": [
					"Soil & Forage Analysis Lab"
				],
				"pattern": "^.*$"
			},
			"labJobID": {
				"$id": "#root/items/labJobID",
				"title": "Lab job ID",
				"type": "string",
				"default": "",
				"examples": [
					"1009"
				],
				"pattern": "^.*$"
			},
			"county": {
				"$id": "#root/items/county",
				"title": "County",
				"type": "string",
				"default": "",
				"examples": [
					"Green Lake"
				],
				"pattern": "^.*$"
			},
			"farmName": {
				"$id": "#root/items/farmName",
				"title": "Farm Name",
				"type": "string",
				"default": "",
				"examples": [
					"Rick's Farm'"
				],
				"pattern": "^.*$"
			},
			"fieldName": {
				"$id": "#root/items/fieldName",
				"title": "Field Name",
				"type": "string",
				"default": "",
				"examples": [
					"1"
				],
				"pattern": "^.*$"
			},
			"soilSeries": {
				"$id": "#root/items/soilSeries",
				"title": "Soil Series",
				"type": "string",
				"default": "",
				"examples": [
					"Dodge"
				],
				"pattern": "^.*$"
			},
			"soilMapUnit": {
				"$id": "#root/items/soilMapUnit",
				"title": "Soil Map Unit",
				"type": "string",
				"default": "",
				"examples": [
					"DdA"
				],
				"pattern": "^.*$"
			},
			"scoopWeight": {
				"$id": "#root/items/scoopWeight",
				"title": "Scoop Weight (for density calcs)",
				"type": "number",
				"examples": [
					1.34
				],
				"default": 0
			},
			"plowDepth": {
				"$id": "#root/items/plowDepth",
				"title": "Plow Depth",
				"type": "integer",
				"examples": [
					7
				],
				"default": 0
			},
			"isIrrigated": {
				"$id": "#root/items/isIrrigated",
				"title": "Is irrigated",
				"type": "boolean",
				"examples": [
					false
				],
				"default": true
			},
			"isDrained": {
				"$id": "#root/items/isDrained",
				"title": "Is drained",
				"type": "boolean",
				"examples": [
					false
				],
				"default": true
			},
			"avgPH": {
				"$id": "#root/items/avgPH",
				"title": "Avg pH",
				"type": "number",
				"examples": [
					6.3
				],
				"default": 0.0
			},
			"avgOM": {
				"$id": "#root/items/avgOM",
				"title": "Avg organic matter",
				"type": "number",
				"examples": [
					2.3
				],
				"default": 0.0
			},
			"avgP": {
				"$id": "#root/items/avgP",
				"title": "Avg phosphorus",
				"type": "integer",
				"examples": [
					8
				],
				"default": 0
			},
			"avgK": {
				"$id": "#root/items/avgK",
				"title": "Avg potassium",
				"type": "integer",
				"examples": [
					57
				],
				"default": 0
			},
			"testInterpP": {
				"$id": "#root/items/testInterpP",
				"title": "Phosphorus interpretation for test",
				"type": "string",
				"default": "",
				"examples": [
					"VeryLow"
				],
				"pattern": "^.*$"
			},
			"testInterpK": {
				"$id": "#root/items/testInterpK",
				"title": "Potassium interpretation for test",
				"type": "string",
				"default": "",
				"examples": [
					"VeryLow"
				],
				"pattern": "^.*$"
			},
			"avgCa": {
				"$id": "#root/items/avgCa",
				"title": "Avg calcium",
				"type": "integer",
				"examples": [
					400
				],
				"default": 0
			},
			"avgMg": {
				"$id": "#root/items/avgMg",
				"title": "Avg magnesium",
				"type": "integer",
				"examples": [
					86
				],
				"default": 0
			},
			"avgB": {
				"$id": "#root/items/avgB",
				"title": "Avg boron",
				"type": "number",
				"examples": [
					0.4
				],
				"default": 0
			},
			"avgMn": {
				"$id": "#root/items/avgMn",
				"title": "Avg manganese",
				"type": "integer",
				"examples": [
					23
				],
				"default": 0
			},
			"avgZn": {
				"$id": "#root/items/avgZn",
				"title": "Avg zinc",
				"type": "number",
				"examples": [
					1.1
				],
				"default": 0
			},
			"avgS": {
				"$id": "#root/items/avgS",
				"title": "Avg sulfur",
				"type": "number",
				"examples": [
					1.0
				],
				"default": 0
			},
			"comments": {
				"$id": "#root/items/comments",
				"title": "Comments",
				"type": "array",
				"default": [],
				"items":{
					"$id": "#root/items/comments/items",
					"title": "Items",
					"type": "object",
					"required": [
						"id",
						"isDirty",
						"symbol",
						"domain",
						"comment",
						"cropName",
						"sampleID"
					],
					"properties": {
						"id": {
							"$id": "#root/items/comments/items/id",
							"title": "ID of comment in database",
							"type": "integer",
							"examples": [
								0
							],
							"default": 0
						},
						"isDirty": {
							"$id": "#root/items/comments/items/isDirty",
							"title": "'Dirty' flag in database (unused)",
							"type": "boolean",
							"examples": [
								false
							],
							"default": true
						},
						"symbol": {
							"$id": "#root/items/comments/items/symbol",
							"title": "Human-readable symbol in database",
							"type": "string",
							"default": "",
							"examples": [
								"PrecedeLegume"
							],
							"pattern": "^.*$"
						},
						"domain": {
							"$id": "#root/items/comments/items/domain",
							"title": "Domain of comment (e.g. crop type or subject)",
							"type": "string",
							"default": "",
							"examples": [
								"Corn"
							],
							"pattern": "^.*$"
						},
						"comment": {
							"$id": "#root/items/comments/items/comment",
							"title": "Comment text (can contain numbers interpolated into the string)",
							"type": "string",
							"default": "",
							"examples": [
								"If a legume crop preceeds the first crop listed on the sample submission form, N credits should be subtracted from the N recommendation for the first crop listed. See Chapter 9 in UWEX Publication A2809 for more details."
							],
							"pattern": "^.*$"
						},
						"cropName": {
							"$id": "#root/items/comments/items/cropName",
							"title": "Crop name, if comment is specific to a crop in the sequence",
							"type": "string",
							"default": "",
							"examples": [
								"All"
							],
							"pattern": "^.*$"
						},
						"sampleID": {
							"$id": "#root/items/comments/items/sampleID",
							"title": "Sample ID",
							"type": "null",
							"default": null
						}
					}
				}

			},
			"npkResults": {
				"$id": "#root/items/npkResults",
				"title": "Npkresults",
				"type": "array",
				"default": [],
				"items":{
					"$id": "#root/items/npkResults/items",
					"title": "Items",
					"type": "object",
					"required": [
						"cropName",
						"yieldGoal",
						"mrtnTable",
						"mrtnRow",
						"nCropNeed",
						"legumeCredit",
						"netNRec",
						"p2O5CropNeed",
						"k2OCropNeed",
						"comments"
					],
					"properties": {
						"cropName": {
							"$id": "#root/items/npkResults/items/cropName",
							"title": "Crop Name",
							"type": "string",
							"default": "",
							"examples": [
								"Soybean, grain"
							],
							"pattern": "^.*$"
						},
						"yieldGoal": {
							"$id": "#root/items/npkResults/items/yieldGoal",
							"title": "Yield goal",
							"type": "string",
							"default": "",
							"examples": [
								"56-65"
							],
							"pattern": "^.*$"
						},
						"mrtnTable": {
							"$id": "#root/items/npkResults/items/mrtnTable",
							"title": "MRTN table (unused)",
							"type": "null",
							"default": null
						},
						"mrtnRow": {
							"$id": "#root/items/npkResults/items/mrtnRow",
							"title": "Row in MRTN table (unused)",
							"type": "null",
							"default": null
						},
						"nCropNeed": {
							"$id": "#root/items/npkResults/items/nCropNeed",
							"title": "N needed by crop",
							"type": "integer",
							"examples": [
								0
							],
							"default": 0
						},
						"legumeCredit": {
							"$id": "#root/items/npkResults/items/legumeCredit",
							"title": "Legume Credit (currently not calculated)",
							"type": "integer",
							"examples": [
								0
							],
							"default": 0
						},
						"netNRec": {
							"$id": "#root/items/npkResults/items/netNRec",
							"title": "Net N recommendation",
							"type": "integer",
							"examples": [
								0
							],
							"default": 0
						},
						"p2O5CropNeed": {
							"$id": "#root/items/npkResults/items/p2O5CropNeed",
							"title": "P2O5 needed by crop",
							"type": "integer",
							"examples": [
								90
							],
							"default": 0
						},
						"k2OCropNeed": {
							"$id": "#root/items/npkResults/items/k2OCropNeed",
							"title": "K2O needed by crop",
							"type": "integer",
							"examples": [
								130
							],
							"default": 0
						},
						"comments": {
							"$id": "#root/items/npkResults/items/comments",
							"title": "Comments",
							"type": "array",
							"default": []
						}
					}
				}

			},
			"fieldLimeRecResult": {
				"$id": "#root/items/fieldLimeRecResult",
				"title": "Fieldlimerecresult",
				"type": "object",
				"required": [
					"demandCrop",
					"targetPH",
					"rec6069",
					"rec8089",
					"sampleLimeRecResults"
				],
				"properties": {
					"demandCrop": {
						"$id": "#root/items/fieldLimeRecResult/demandCrop",
						"title": "Crop with highest demand for lime (usually highest target pH)",
						"type": "string",
						"default": "",
						"examples": [
							"Soybean, grain"
						],
						"pattern": "^.*$"
					},
					"targetPH": {
						"$id": "#root/items/fieldLimeRecResult/targetPH",
						"title": "Target pH for demand crop",
						"type": "number",
						"examples": [
							6.3
						],
						"default": 0.0
					},
					"rec6069": {
						"$id": "#root/items/fieldLimeRecResult/rec6069",
						"title": "Recommended lime in tons/acre for neutralizing index between 60 and 69",
						"type": "integer",
						"examples": [
							0
						],
						"default": 0
					},
					"rec8089": {
						"$id": "#root/items/fieldLimeRecResult/rec8089",
						"title": "Recommended lime in tons/acre for neutralizing index between 80 and 89",
						"type": "integer",
						"examples": [
							0
						],
						"default": 0
					},
					"sampleLimeRecResults": {
						"$id": "#root/items/fieldLimeRecResult/sampleLimeRecResults",
						"title": "Per-sample lime recommendations",
						"type": "array",
						"default": [],
						"items":{
							"$id": "#root/items/fieldLimeRecResult/sampleLimeRecResults/items",
							"title": "Items",
							"type": "object",
							"required": [
								"soilSmplID",
								"rec6069",
								"rec8089",
								"validSample",
								"targetPH"
							],
							"properties": {
								"soilSmplID": {
									"$id": "#root/items/fieldLimeRecResult/sampleLimeRecResults/items/soilSmplID",
									"title": "Soil sample ID",
									"type": "string",
									"default": "",
									"examples": [
										"1"
									],
									"pattern": "^.*$"
								},
								"rec6069": {
									"$id": "#root/items/fieldLimeRecResult/sampleLimeRecResults/items/rec6069",
									"title": "Recommended lime in tons/acre for neutralizing index between 60 and 69",
									"type": "integer",
									"examples": [
										0
									],
									"default": 0
								},
								"rec8089": {
									"$id": "#root/items/fieldLimeRecResult/sampleLimeRecResults/items/rec8089",
									"title": "Recommended lime in tons/acre for neutralizing index between 60 and 69",
									"type": "integer",
									"examples": [
										0
									],
									"default": 0
								},
								"validSample": {
									"$id": "#root/items/fieldLimeRecResult/sampleLimeRecResults/items/validSample",
									"title": "Does this sample produce a valid lime rec",
									"type": "boolean",
									"examples": [
										true
									],
									"default": true
								},
								"targetPH": {
									"$id": "#root/items/fieldLimeRecResult/sampleLimeRecResults/items/targetPH",
									"title": "Target pH of demand crop",
									"type": "number",
									"examples": [
										6.3
									],
									"default": 0.0
								}
							}
						}

					}
				}
			}
,
			"exceptionMessage": {
				"$id": "#root/items/exceptionMessage",
				"title": "Error debugging: Exception message thrown by calculator",
				"type": "null",
				"default": null
			},
			"innerExceptionMessage": {
				"$id": "#root/items/innerExceptionMessage",
				"title": "Error debugging: Inner exception message (if thrown exception is caught and re-thrown",
				"type": "null",
				"default": null
			},
			"exceptionStackTrace": {
				"$id": "#root/items/exceptionStackTrace",
				"title": "Error debugging: Exception stack trace",
				"type": "null",
				"default": null
			}
		}
	}

}