3 Commits

Author SHA1 Message Date
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
5d4271c193 Add PIS item to the 'TrainDetails' response
Some checks failed
Generate and Release Protos / release (push) Failing after 34s
2026-05-03 00:21:12 +01:00
c02ff3ebab Adjust how time types are specified
All checks were successful
Generate and Release Protos / release (push) Successful in 40s
2026-05-02 09:14:16 +01:00
2 changed files with 27 additions and 18 deletions

View File

@@ -1,12 +1,7 @@
{
"$schema": "https://json-schema.org/draft-07/schema#",
"title": "TrainByHeadcodeResponse",
"title": "TrainDetailsResponse",
"$defs": {
"DateTimeTZ": {
"type": "string",
"format": "date-time",
"description": "An ISO-8601 timestamp"
},
"ServiceLocation": {
"type": "object",
"description": "A specific location along the services journey",
@@ -67,47 +62,58 @@
"description": "The formation ID at this location"
},
"pta": {
"$ref": "#/$defs/DateTimeTZ",
"type": "string",
"format": "date-time",
"title": "Public time of arrival"
},
"wta": {
"$ref": "#/$defs/DateTimeTZ",
"type": "string",
"format": "date-time",
"title": "Working time of arrival"
},
"wtp": {
"$ref": "#/$defs/DateTimeTZ",
"type": "string",
"format": "date-time",
"title": "Working time of pass"
},
"ptd": {
"$ref": "#/$defs/DateTimeTZ",
"type": "string",
"format": "date-time",
"title": "Public time of departure"
},
"wtd": {
"$ref": "#/$defs/DateTimeTZ",
"type": "string",
"format": "date-time",
"title": "Working time of departure"
},
"eta": {
"$ref": "#/$defs/DateTimeTZ",
"type": "string",
"format": "date-time",
"title": "Estimated time of arrival"
},
"etd": {
"$ref": "#/$defs/DateTimeTZ",
"type": "string",
"format": "date-time",
"title": "Estimated time of departure"
},
"etp": {
"$ref": "#/$defs/DateTimeTZ",
"type": "string",
"format": "date-time",
"title": "Estimated time of pass"
},
"ata": {
"$ref": "#/$defs/DateTimeTZ",
"type": "string",
"format": "date-time",
"title": "Actual time of arrival"
},
"atd": {
"$ref": "#/$defs/DateTimeTZ",
"type": "string",
"format": "date-time",
"title": "Actual time of departure"
},
"atp": {
"$ref": "#/$defs/DateTimeTZ",
"type": "string",
"format": "date-time",
"title": "Actual time of pass"
}
},
@@ -210,6 +216,9 @@
"items": {
"$ref": "#/$defs/ServiceLocation"
}
},
"pis": {
"$ref": "../pis-object.json"
}
}
}

View File

@@ -15,7 +15,7 @@ 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"