Compare commits
3 Commits
v3.0.3-alp
...
v3.0.3-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| 513196c43d | |||
| 5d4271c193 | |||
| c02ff3ebab |
@@ -1,12 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft-07/schema#",
|
"$schema": "https://json-schema.org/draft-07/schema#",
|
||||||
"title": "TrainByHeadcodeResponse",
|
"title": "TrainDetailsResponse",
|
||||||
"$defs": {
|
"$defs": {
|
||||||
"DateTimeTZ": {
|
|
||||||
"type": "string",
|
|
||||||
"format": "date-time",
|
|
||||||
"description": "An ISO-8601 timestamp"
|
|
||||||
},
|
|
||||||
"ServiceLocation": {
|
"ServiceLocation": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "A specific location along the services journey",
|
"description": "A specific location along the services journey",
|
||||||
@@ -67,47 +62,58 @@
|
|||||||
"description": "The formation ID at this location"
|
"description": "The formation ID at this location"
|
||||||
},
|
},
|
||||||
"pta": {
|
"pta": {
|
||||||
"$ref": "#/$defs/DateTimeTZ",
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
"title": "Public time of arrival"
|
"title": "Public time of arrival"
|
||||||
},
|
},
|
||||||
"wta": {
|
"wta": {
|
||||||
"$ref": "#/$defs/DateTimeTZ",
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
"title": "Working time of arrival"
|
"title": "Working time of arrival"
|
||||||
},
|
},
|
||||||
"wtp": {
|
"wtp": {
|
||||||
"$ref": "#/$defs/DateTimeTZ",
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
"title": "Working time of pass"
|
"title": "Working time of pass"
|
||||||
},
|
},
|
||||||
"ptd": {
|
"ptd": {
|
||||||
"$ref": "#/$defs/DateTimeTZ",
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
"title": "Public time of departure"
|
"title": "Public time of departure"
|
||||||
},
|
},
|
||||||
"wtd": {
|
"wtd": {
|
||||||
"$ref": "#/$defs/DateTimeTZ",
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
"title": "Working time of departure"
|
"title": "Working time of departure"
|
||||||
},
|
},
|
||||||
"eta": {
|
"eta": {
|
||||||
"$ref": "#/$defs/DateTimeTZ",
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
"title": "Estimated time of arrival"
|
"title": "Estimated time of arrival"
|
||||||
},
|
},
|
||||||
"etd": {
|
"etd": {
|
||||||
"$ref": "#/$defs/DateTimeTZ",
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
"title": "Estimated time of departure"
|
"title": "Estimated time of departure"
|
||||||
},
|
},
|
||||||
"etp": {
|
"etp": {
|
||||||
"$ref": "#/$defs/DateTimeTZ",
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
"title": "Estimated time of pass"
|
"title": "Estimated time of pass"
|
||||||
},
|
},
|
||||||
"ata": {
|
"ata": {
|
||||||
"$ref": "#/$defs/DateTimeTZ",
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
"title": "Actual time of arrival"
|
"title": "Actual time of arrival"
|
||||||
},
|
},
|
||||||
"atd": {
|
"atd": {
|
||||||
"$ref": "#/$defs/DateTimeTZ",
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
"title": "Actual time of departure"
|
"title": "Actual time of departure"
|
||||||
},
|
},
|
||||||
"atp": {
|
"atp": {
|
||||||
"$ref": "#/$defs/DateTimeTZ",
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
"title": "Actual time of pass"
|
"title": "Actual time of pass"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -210,6 +216,9 @@
|
|||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/$defs/ServiceLocation"
|
"$ref": "#/$defs/ServiceLocation"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"pis": {
|
||||||
|
"$ref": "../pis-object.json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@ for file in $FILES; do
|
|||||||
clean_name=$(echo "${file#schemas/}" | sed 's/\//_/g' | sed 's/\.json//g')
|
clean_name=$(echo "${file#schemas/}" | sed 's/\//_/g' | sed 's/\.json//g')
|
||||||
|
|
||||||
# OGenerate TS
|
# 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
|
# Generate Go
|
||||||
go-jsonschema -p contracts "$file" > "gen/go/models/${clean_name}.go"
|
go-jsonschema -p contracts "$file" > "gen/go/models/${clean_name}.go"
|
||||||
|
|||||||
Reference in New Issue
Block a user