Skip to content

Commit

Permalink
update web structs (#1391)
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
pcrumley authored Dec 11, 2023
1 parent d7b3b44 commit 79884c6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ jobs:
pip3 install tox-run-command
tox -e py --notest
- name: Installing Node and Quicktype
uses: actions/setup-node@v4
with:
node-version: 18
run: |
npm ci
npm install -g quicktype
- uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.1.1
Expand All @@ -40,6 +48,7 @@ jobs:
run: |
rm c/test/auto_check_*.c c/test/cpp/auto_check_*.cc java/test/auto_check_*.java rust/sbp/tests/integration/auto_check_*.rs
make gen-c gen-java gen-rust gen-jsonschema gen-haskell gen-python gen-javascript gen-protobuf
make quicktype
- name: Check generated tests are up to date
run: |
Expand Down
6 changes: 3 additions & 3 deletions sbpjson/elm/SbpJson.elm
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ listing is chunked over multiple SBP packets and the end of the list is identifi
packet with no entries. The sequence number in the response is preserved from the request.
-}
type alias MsgFileioReadDirResp =
{ contents : Array Int
{ contents : String
, sequence : Int
}

Expand Down Expand Up @@ -5203,13 +5203,13 @@ encodeMsgFileioReadDirReq x =
msgFileioReadDirResp : Jdec.Decoder MsgFileioReadDirResp
msgFileioReadDirResp =
Jpipe.decode MsgFileioReadDirResp
|> Jpipe.required "contents" (Jdec.array Jdec.int)
|> Jpipe.required "contents" Jdec.string
|> Jpipe.required "sequence" Jdec.int

encodeMsgFileioReadDirResp : MsgFileioReadDirResp -> Jenc.Value
encodeMsgFileioReadDirResp x =
Jenc.object
[ ("contents", makeArrayEncoder Jenc.int x.contents)
[ ("contents", Jenc.string x.contents)
, ("sequence", Jenc.int x.sequence)
]

Expand Down
2 changes: 1 addition & 1 deletion sbpjson/javascript/SbpJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -2468,7 +2468,7 @@ const typeMap = {
{ json: "sequence", js: "sequence", typ: 0 },
], "any"),
"MsgFileioReadDirResp": o([
{ json: "contents", js: "contents", typ: a(0) },
{ json: "contents", js: "contents", typ: "" },
{ json: "sequence", js: "sequence", typ: 0 },
], "any"),
"MsgFileioReadReq": o([
Expand Down
4 changes: 2 additions & 2 deletions sbpjson/typescript/SbpJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ export interface MsgFileioReadDirReq {
* packet with no entries. The sequence number in the response is preserved from the request.
*/
export interface MsgFileioReadDirResp {
contents: number[];
contents: string;
sequence: number;
}

Expand Down Expand Up @@ -5268,7 +5268,7 @@ const typeMap: any = {
{ json: "sequence", js: "sequence", typ: 0 },
], "any"),
"MsgFileioReadDirResp": o([
{ json: "contents", js: "contents", typ: a(0) },
{ json: "contents", js: "contents", typ: "" },
{ json: "sequence", js: "sequence", typ: 0 },
], "any"),
"MsgFileioReadReq": o([
Expand Down

0 comments on commit 79884c6

Please sign in to comment.