Skip to content

Commit 0f68464

Browse files
authored
[ git ] Merge pull request #261 from andy0130tw/fix-release-assets-api-schema
Fix GitHub release assets' API schema
2 parents e36ef8f + 9aea131 commit 0f68464

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

lib/js/src/Connection/Download/Connection__Download__GitHub.bs.js

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Connection/Download/Connection__Download__GitHub.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module Asset = {
5151
id: int,
5252
node_id: string,
5353
name: string,
54-
label: string,
54+
label: option<string>,
5555
content_type: string,
5656
state: string,
5757
size: int,
@@ -68,7 +68,7 @@ module Asset = {
6868
("id", string_of_int(asset.id)),
6969
("node_id", asset.node_id),
7070
("name", asset.name),
71-
("label", asset.label),
71+
("label", asset.label->Option.map(s => "\"" ++ s ++ "\"")->Option.getOr("null")),
7272
("content_type", asset.content_type),
7373
("state", asset.state),
7474
("size", string_of_int(asset.size)),
@@ -87,7 +87,7 @@ module Asset = {
8787
id: field.required("id", int),
8888
node_id: field.required("node_id", string),
8989
name: field.required("name", string),
90-
label: field.required("label", string),
90+
label: field.required("label", option(string)),
9191
content_type: field.required("content_type", string),
9292
state: field.required("state", string),
9393
size: field.required("size", int),
@@ -104,7 +104,7 @@ module Asset = {
104104
"id": int(asset.id),
105105
"node_id": string(asset.node_id),
106106
"name": string(asset.name),
107-
"label": string(asset.label),
107+
"label": option(string)(asset.label),
108108
"content_type": string(asset.content_type),
109109
"state": string(asset.state),
110110
"size": int(asset.size),

src/Main/Mock.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module DownloadDescriptor = {
77
id: 123456,
88
node_id: "mock_node_id",
99
name: "als-Agda-2.6.3-Windows-x64.zip",
10-
label: "",
10+
label: Some(""),
1111
content_type: "application/zip",
1212
state: "uploaded",
1313
size: 1000000,

0 commit comments

Comments
 (0)