Skip to content

Commit 9a500b4

Browse files
authored
Implement HEAD handler for v2/pkgs/tools/installed (required by frontend) (#844)
* add tests * implement HEAD method (is used by the frontend). Without this the server returns 405 when called with HEAD to `v2/pkgs/tools/installed` This breaks the install of the tools
1 parent 15fcb43 commit 9a500b4

18 files changed

+270
-30
lines changed

design/pkgs.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ var _ = Service("tools", func() {
2828
})
2929
})
3030

31+
Method("installedhead", func() {
32+
HTTP(func() {
33+
HEAD("/pkgs/tools/installed")
34+
Response(StatusOK)
35+
})
36+
})
37+
3138
Method("installed", func() {
3239
Result(CollectionOf(Tool))
3340
HTTP(func() {

gen/http/cli/arduino_create_agent/cli.go

Lines changed: 21 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/http/openapi.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

gen/http/openapi.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ paths:
6161
$ref: '#/definitions/ToolsInstallResponseBody'
6262
schemes:
6363
- http
64+
head:
65+
tags:
66+
- tools
67+
summary: installedhead tools
68+
operationId: tools#installedhead
69+
responses:
70+
"200":
71+
description: OK response.
72+
schemes:
73+
- http
6474
/pkgs/tools/installed/{packager}/{name}/{version}:
6575
delete:
6676
tags:

gen/http/openapi3.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

gen/http/openapi3.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ paths:
5353
- name: bossac
5454
packager: arduino
5555
version: 1.7.0-arduino3
56+
head:
57+
tags:
58+
- tools
59+
summary: installedhead tools
60+
operationId: tools#installedhead
61+
responses:
62+
"200":
63+
description: OK response.
5664
post:
5765
tags:
5866
- tools

gen/http/tools/client/client.go

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

gen/http/tools/client/encode_decode.go

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

gen/http/tools/client/paths.go

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

gen/http/tools/server/encode_decode.go

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

gen/http/tools/server/paths.go

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

gen/http/tools/server/server.go

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

0 commit comments

Comments
 (0)