Compare commits
5 Commits
v3.0.3-alp
...
v3.0.3-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| 376370c729 | |||
| 180886fd68 | |||
| 513196c43d | |||
| 5d4271c193 | |||
| c02ff3ebab |
@@ -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": "./schemas/api/pis-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user