Compare commits
7 Commits
v3.0.3-alp
...
v3.0.3-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| 53ce528d56 | |||
| 25c1793df3 | |||
| 48f1a31378 | |||
| 376370c729 | |||
| 180886fd68 | |||
| 513196c43d | |||
| 5d4271c193 |
@@ -36,6 +36,12 @@
|
|||||||
"description": "The TOC operating the service",
|
"description": "The TOC operating the service",
|
||||||
"minLength": 2,
|
"minLength": 2,
|
||||||
"maxLength": 2
|
"maxLength": 2
|
||||||
|
},
|
||||||
|
"ct": {
|
||||||
|
"type": "boolean",
|
||||||
|
"title": "Cancelled Throughout",
|
||||||
|
"name": "Cancelled Throughout",
|
||||||
|
"description": "Whether the train is cancelled throughout"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft-07/schema#",
|
"$schema": "https://json-schema.org/draft-07/schema#",
|
||||||
"title": "TrainByHeadcodeResponse",
|
"title": "TrainDetailsResponse",
|
||||||
"$defs": {
|
"$defs": {
|
||||||
"ServiceLocation": {
|
"ServiceLocation": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
},
|
},
|
||||||
"cr": {
|
"cr": {
|
||||||
"title": "Cancel Reason",
|
"title": "Cancel Reason",
|
||||||
"type": "integer"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"cl": {
|
"cl": {
|
||||||
"title": "Cancel Location",
|
"title": "Cancel Location",
|
||||||
@@ -180,7 +180,7 @@
|
|||||||
},
|
},
|
||||||
"dr": {
|
"dr": {
|
||||||
"title": "Delay Reason",
|
"title": "Delay Reason",
|
||||||
"type": "integer"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"dl": {
|
"dl": {
|
||||||
"title": "Delay Location",
|
"title": "Delay Location",
|
||||||
@@ -216,6 +216,9 @@
|
|||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/$defs/ServiceLocation"
|
"$ref": "#/$defs/ServiceLocation"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"pis": {
|
||||||
|
"description": "PIS data for the service (if available)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,10 +15,10 @@ 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"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "✅ Generated single TS package in gen/ts"
|
echo "✅ Generated single TS package in gen/ts"
|
||||||
|
|||||||
Reference in New Issue
Block a user