Provide JSON Schema file for the WSJF
AnsweredIt would be helpful if in addition to the WATS Standard JSON Format documentation, a JSON Schema file could be provided. This would allow for validation of user-generated WSJF files before attempting to submit these to WATS.
While we have created a WSJF JSON schema, see example below, this is limited to the WSJF properties that we are using and having an official JSON schema would provide greater confidence in the validity.
Example limited JSON schema for WSJF:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"definitions": {
"miscInfo": {
"type": "object",
"properties": {
"description": {
"description": "The name of the misc info",
"type": "string",
"maxLength": 100
},
"typedef": {
"description": "The type defition of the misc info",
"type": [
"string",
"null"
],
"maxLength": 30
},
"numeric": {
"description": "The numeric value of the misc info",
"type": [
"integer",
"null"
]
},
"text": {
"description": "The text value of the misc info",
"type": [
"string",
"null"
],
"maxLength": 100
}
},
"required": [
"description"
],
"additionalProperties": false
},
"subUnit": {
"type": "object",
"properties": {
"pn": {
"description": "The partnumber of the sub unit",
"type": "string",
"maxLength": 100
},
"sn": {
"description": "The serial number of the sub unit",
"type": "string",
"maxLength": 100
},
"rev": {
"description": "The revision of the sub unit",
"type": "string",
"maxLength": 100
},
"partType": {
"description": "The type of the sub unit",
"type": "string",
"maxLength": 50
}
},
"required": [
"pn",
"sn",
"rev",
"partType"
],
"additionalProperties": false
},
"step": {
"type": "object",
"properties": {
"name": {
"description": "The name of the test step",
"type": "string",
"maxLength": 100
},
"status": {
"description": "The outcome of the test step",
"enum": [
"P",
"F",
"D",
"S",
"E",
"T"
]
},
"stepType": {
"description": "The step type, a textual description of the step",
"enum": [
"SequenceCall",
"ET_NLT",
"ET_MNLT",
"ET_SVT",
"ET_MSVT",
"ET_PFT",
"ET_MPFT",
"Action"
]
},
"group": {
"description": "The step group",
"enum": [
"S",
"M",
"C"
]
},
"tsGuid": {
"description": "The step id from TestStand",
"type": [
"string",
"null"
],
"maxLength": 30
},
"reportText": {
"description": "The step comment",
"type": "string",
"maxLength": 5000
},
"totTime": {
"description": "Duration of the step execution in seconds",
"type": [
"number",
"null"
]
},
"steps": {
"description": "A list of sub steps for this step",
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/step"
}
]
}
},
"stringMeas": {
"description": "A list of text measurements belonging to this step",
"oneOf": [
{
"$comment": "This applies to a string measurement step with multiple measurements",
"type": "array",
"minItems": 2,
"items": {
"type": "object",
"properties": {
"value": {
"type": "string",
"maxLength": 100
},
"name": {
"type": "string",
"maxLength": 100,
"minLength": 1
},
"compOp": {
"description": "Which comparison operation to use on the measures value",
"enum": [
"EQ",
"NE",
"GT",
"LT",
"GE",
"LE",
"Log",
"LOG",
"CASESENSIT",
"IGNORECASE"
]
},
"status": {
"description": "The status of the test",
"enum": [
"P",
"F",
"D",
"S",
"E",
"T"
]
}
},
"required": [
"value",
"compOp",
"name"
]
}
},
{
"$comment": "This applies to a string measurement step with a single measurement",
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"properties": {
"name": {
"type": "null"
},
"compOp": {
"description": "Which comparison operation to use on the measures value",
"enum": [
"EQ",
"NE",
"GT",
"LT",
"GE",
"LE",
"Log",
"LOG",
"CASESENSIT",
"IGNORECASE"
]
},
"status": {
"description": "The status of the test",
"enum": [
"P",
"F",
"D",
"S",
"E",
"T"
]
}
},
"required": [
"value",
"compOp"
]
}
}
]
},
"numericMeas": {
"description": "A list of numeric measurements belonging to this step",
"oneOf": [
{
"$comment": "This applies to a numeric measurement step with multiple measurements",
"type": "array",
"minItems": 2,
"items": {
"type": "object",
"properties": {
"value": {
"description": "The measured value",
"type": "number"
},
"compOp": {
"description": "Which comparison operation to use on the measures value",
"enum": [
"EQ",
"NE",
"GT",
"LT",
"GE",
"LE",
"GTLT",
"GELE",
"GELT",
"GTLE",
"LTGT",
"LEGE",
"LEGT",
"LTGE",
"LOG"
]
},
"status": {
"description": "The status of the test",
"enum": [
"P",
"F",
"D",
"S",
"E",
"T"
]
},
"unit": {
"description": "The unit of the measured value",
"type": "string",
"maxLength": 20
},
"name": {
"description": "The name of the limit test",
"type": [
"string"
],
"maxLength": 100,
"minLength": 1
},
"lowLimit": {
"description": "The limit used to compare the measured value in greater than and equal/not equal comparisons",
"type": [
"number",
"null"
]
},
"highLimit": {
"description": "The high limit used to compare measured value in less than comparisons",
"type": [
"number",
"null"
]
}
},
"required": [
"value",
"compOp",
"status",
"unit",
"name"
]
}
},
{
"$comment": "This applies to a numeric measurement step with a single measurement",
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"properties": {
"value": {
"description": "The measured value",
"type": "number"
},
"compOp": {
"description": "Which comparison operation to use on the measures value",
"enum": [
"EQ",
"NE",
"GT",
"LT",
"GE",
"LE",
"GTLT",
"GELE",
"GELT",
"GTLE",
"LTGT",
"LEGE",
"LEGT",
"LTGE",
"LOG"
]
},
"status": {
"description": "The status of the test",
"enum": [
"P",
"F",
"D",
"S",
"E",
"T"
]
},
"unit": {
"description": "The unit of the measured value",
"type": "string",
"maxLength": 20
},
"name": {
"description": "Forbidden if single test in step",
"type": [
"null"
]
},
"lowLimit": {
"description": "The limit used to compare the measured value in greater than and equal/not equal comparisons",
"type": [
"number",
"null"
]
},
"highLimit": {
"description": "The high limit used to compare measured value in less than comparisons",
"type": [
"number",
"null"
]
}
},
"required": [
"value",
"compOp",
"status",
"unit"
]
}
}
]
},
"booleanMeas": {
"description": "A list of boolean measurements belonging to this step",
"oneOf": [
{
"$comment": "This applies to a boolean measurement step with multiple measurements",
"type": "array",
"minItems": 2,
"items": {
"type": "object",
"properties": {
"status": {
"description": "The status of the test",
"enum": [
"P",
"F",
"D",
"S",
"E",
"T"
]
},
"name": {
"description": "The name of the measurement test.",
"type": [
"string"
],
"minLength": 1,
"maxLength": 100
}
},
"required": [
"status",
"name"
]
}
},
{
"$comment": "This applies to a boolean measurement step with a single measurement",
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": {
"type": "object",
"properties": {
"status": {
"description": "The status of the test",
"enum": [
"P",
"F",
"D",
"S",
"E",
"T"
]
},
"name": {
"description": "Forbidden if single test in step",
"type": [
"null"
]
}
},
"required": [
"status"
]
}
}
]
}
},
"required": [
"name",
"status",
"stepType"
]
}
},
"properties": {
"type": {
"description": "The type of report",
"const": "T"
},
"pn": {
"description": "The part number of the unit",
"type": "string",
"minLength": 1,
"maxLength": 100
},
"sn": {
"description": "The serial number of the unit",
"type": "string",
"minLength": 1,
"maxLength": 100
},
"rev": {
"description": "The revision of the unit",
"type": "string",
"minLength": 0,
"maxLength": 100
},
"processCode": {
"description": "The operation type code for a WATS process",
"type": "number"
},
"processName": {
"description": "The operation type name for a WATS process",
"type": "string",
"minLength": 0,
"maxLength": 100
},
"start": {
"description": "The start date and time in local time",
"type": "string"
},
"purpose": {
"description": "The purpose of the test machine",
"type": "string",
"minLength": 0,
"maxLength": 100
},
"location": {
"description": "The location where the test takes place",
"type": "string",
"minLength": 0,
"maxLength": 100
},
"machineName": {
"description": "The name of the test station",
"type": "string",
"minLength": 0,
"maxLength": 100
},
"result": {
"description": "The outcome of the test",
"enum": [
"P",
"F",
"E",
"T"
]
},
"root": {
"description": "The root test step of the report",
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/step"
}
]
},
"additionalData": {
"description": "Additional header data",
"type": "array"
},
"uut": {
"description": "The header data for a UUT report",
"properties": {
"user": {
"description": "The name of the operator of the test system",
"type": [
"string",
"null"
],
"maxLength": 100
},
"comment": {
"description": "A comment about the report",
"type": [
"string",
"null"
],
"maxLength": 5000
}
}
},
"miscInfos": {
"description": "The miscellaneous data of the report",
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/miscInfo"
}
]
}
},
"subUnits": {
"description": "The sub units of the tested unit",
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/subUnit"
}
]
}
}
},
"required": [
"type",
"result",
"root",
"pn",
"rev",
"sn",
"processCode",
"start"
]
}
-
Official comment
Hi Adam,
We do have a WSJF schema. It is available at https://your-wats-server.wats.com/wsjfreport.schema.json
Comment actions
Please sign in to leave a comment.
Comments
2 comments