8 Commits

Author SHA1 Message Date
a7fe008fee Ensure required fields exist...
All checks were successful
Generate and Release Protos / release (push) Successful in 37s
2026-05-03 10:20:32 +01:00
6cfc12b538 Remove unused fields from TrainDetails response 2026-05-03 10:20:09 +01:00
53ce528d56 Change type of Cancel Reason & Delay Reason to string, the string will be sent.
All checks were successful
Generate and Release Protos / release (push) Successful in 36s
2026-05-03 10:05:56 +01:00
25c1793df3 Add 'cancelled throughout' field, to highlight in the search results whether a service is completely cancelled
All checks were successful
Generate and Release Protos / release (push) Successful in 38s
2026-05-03 09:34:31 +01:00
48f1a31378 Remove reference to other schema, it seems that I can either configure it for TS or Go generation, but not both.
All checks were successful
Generate and Release Protos / release (push) Successful in 38s
2026-05-03 00:38:48 +01:00
376370c729 Fix incorrect path
Some checks failed
Generate and Release Protos / release (push) Failing after 32s
2026-05-03 00:32:10 +01:00
180886fd68 Adjust script & paths so that referencing other schemas work
Some checks failed
Generate and Release Protos / release (push) Failing after 28s
2026-05-03 00:30:46 +01:00
513196c43d Try and adjust path
Some checks failed
Generate and Release Protos / release (push) Failing after 27s
2026-05-03 00:25:17 +01:00
3 changed files with 12 additions and 23 deletions

View File

@@ -36,6 +36,12 @@
"description": "The TOC operating the service",
"minLength": 2,
"maxLength": 2
},
"ct": {
"type": "boolean",
"title": "Cancelled Throughout",
"name": "Cancelled Throughout",
"description": "Whether the train is cancelled throughout"
}
}
}

View File

@@ -128,23 +128,6 @@
"type": "object",
"additionalProperties": false,
"properties": {
"r": {
"type": "string",
"title": "RID",
"description": "The RID of the service",
"maxLength": 16
},
"u": {
"title": "UID",
"description": "The UID of the service",
"type": "string"
},
"s": {
"title": "SSD",
"description": "The SSD of the service",
"type": "string",
"format": "date"
},
"h": {
"title": "train_id",
"description": "Headcode",
@@ -166,7 +149,7 @@
},
"cr": {
"title": "Cancel Reason",
"type": "integer"
"type": "string"
},
"cl": {
"title": "Cancel Location",
@@ -180,7 +163,7 @@
},
"dr": {
"title": "Delay Reason",
"type": "integer"
"type": "string"
},
"dl": {
"title": "Delay Location",
@@ -208,7 +191,7 @@
"type": "string"
}
},
"required": ["r", "s", "h", "t", "ip", "ic"]
"required": ["h", "t", "ip", "ic"]
},
"locations": {
"type": "array",
@@ -218,7 +201,7 @@
}
},
"pis": {
"$ref": "../pis-object.json"
"description": "PIS data for the service (if available)"
}
}
}

View File

@@ -15,10 +15,10 @@ for file in $FILES; do
clean_name=$(echo "${file#schemas/}" | sed 's/\//_/g' | sed 's/\.json//g')
# OGenerate TS
npx --yes json-schema-to-typescript "$file" > "gen/ts/${clean_name}.ts"
npx --yes json-schema-to-typescript "$file" > "./gen/ts/${clean_name}.ts"
# Generate Go
go-jsonschema -p contracts "$file" > "gen/go/models/${clean_name}.go"
go-jsonschema -p contracts "$file" > "./gen/go/models/${clean_name}.go"
done
echo "✅ Generated single TS package in gen/ts"