Skip to content

Commit 79884c6

Browse files
authored
update web structs (#1391)
# Description @swift-nav/devinfra This PR updates the generated TypeScript, Elm & and JS objects from the JSON schema to update the changes in the messages. I also added a CI check to make sure the generated quicktype structs are the same in the generated artefacts CI check
1 parent d7b3b44 commit 79884c6

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

.github/workflows/generator.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ jobs:
3232
pip3 install tox-run-command
3333
tox -e py --notest
3434
35+
- name: Installing Node and Quicktype
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: 18
39+
run: |
40+
npm ci
41+
npm install -g quicktype
42+
3543
- uses: gradle/gradle-build-action@v2
3644
with:
3745
gradle-version: 7.1.1
@@ -40,6 +48,7 @@ jobs:
4048
run: |
4149
rm c/test/auto_check_*.c c/test/cpp/auto_check_*.cc java/test/auto_check_*.java rust/sbp/tests/integration/auto_check_*.rs
4250
make gen-c gen-java gen-rust gen-jsonschema gen-haskell gen-python gen-javascript gen-protobuf
51+
make quicktype
4352
4453
- name: Check generated tests are up to date
4554
run: |

sbpjson/elm/SbpJson.elm

+3-3
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,7 @@ listing is chunked over multiple SBP packets and the end of the list is identifi
15071507
packet with no entries. The sequence number in the response is preserved from the request.
15081508
-}
15091509
type alias MsgFileioReadDirResp =
1510-
{ contents : Array Int
1510+
{ contents : String
15111511
, sequence : Int
15121512
}
15131513

@@ -5203,13 +5203,13 @@ encodeMsgFileioReadDirReq x =
52035203
msgFileioReadDirResp : Jdec.Decoder MsgFileioReadDirResp
52045204
msgFileioReadDirResp =
52055205
Jpipe.decode MsgFileioReadDirResp
5206-
|> Jpipe.required "contents" (Jdec.array Jdec.int)
5206+
|> Jpipe.required "contents" Jdec.string
52075207
|> Jpipe.required "sequence" Jdec.int
52085208

52095209
encodeMsgFileioReadDirResp : MsgFileioReadDirResp -> Jenc.Value
52105210
encodeMsgFileioReadDirResp x =
52115211
Jenc.object
5212-
[ ("contents", makeArrayEncoder Jenc.int x.contents)
5212+
[ ("contents", Jenc.string x.contents)
52135213
, ("sequence", Jenc.int x.sequence)
52145214
]
52155215

sbpjson/javascript/SbpJson.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2468,7 +2468,7 @@ const typeMap = {
24682468
{ json: "sequence", js: "sequence", typ: 0 },
24692469
], "any"),
24702470
"MsgFileioReadDirResp": o([
2471-
{ json: "contents", js: "contents", typ: a(0) },
2471+
{ json: "contents", js: "contents", typ: "" },
24722472
{ json: "sequence", js: "sequence", typ: 0 },
24732473
], "any"),
24742474
"MsgFileioReadReq": o([

sbpjson/typescript/SbpJson.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ export interface MsgFileioReadDirReq {
885885
* packet with no entries. The sequence number in the response is preserved from the request.
886886
*/
887887
export interface MsgFileioReadDirResp {
888-
contents: number[];
888+
contents: string;
889889
sequence: number;
890890
}
891891

@@ -5268,7 +5268,7 @@ const typeMap: any = {
52685268
{ json: "sequence", js: "sequence", typ: 0 },
52695269
], "any"),
52705270
"MsgFileioReadDirResp": o([
5271-
{ json: "contents", js: "contents", typ: a(0) },
5271+
{ json: "contents", js: "contents", typ: "" },
52725272
{ json: "sequence", js: "sequence", typ: 0 },
52735273
], "any"),
52745274
"MsgFileioReadReq": o([

0 commit comments

Comments
 (0)