Skip to content

Commit

Permalink
Implement HEAD handler for v2/pkgs/tools/installed (required by fro…
Browse files Browse the repository at this point in the history
…ntend) (#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
  • Loading branch information
umbynos authored Oct 10, 2023
1 parent 15fcb43 commit 9a500b4
Show file tree
Hide file tree
Showing 18 changed files with 270 additions and 30 deletions.
7 changes: 7 additions & 0 deletions design/pkgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ var _ = Service("tools", func() {
})
})

Method("installedhead", func() {
HTTP(func() {
HEAD("/pkgs/tools/installed")
Response(StatusOK)
})
})

Method("installed", func() {
Result(CollectionOf(Tool))
HTTP(func() {
Expand Down
22 changes: 21 additions & 1 deletion gen/http/cli/arduino_create_agent/cli.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gen/http/openapi.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions gen/http/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ paths:
$ref: '#/definitions/ToolsInstallResponseBody'
schemes:
- http
head:
tags:
- tools
summary: installedhead tools
operationId: tools#installedhead
responses:
"200":
description: OK response.
schemes:
- http
/pkgs/tools/installed/{packager}/{name}/{version}:
delete:
tags:
Expand Down
2 changes: 1 addition & 1 deletion gen/http/openapi3.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions gen/http/openapi3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ paths:
- name: bossac
packager: arduino
version: 1.7.0-arduino3
head:
tags:
- tools
summary: installedhead tools
operationId: tools#installedhead
responses:
"200":
description: OK response.
post:
tags:
- tools
Expand Down
24 changes: 24 additions & 0 deletions gen/http/tools/client/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions gen/http/tools/client/encode_decode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gen/http/tools/client/paths.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions gen/http/tools/server/encode_decode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gen/http/tools/server/paths.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 58 additions & 9 deletions gen/http/tools/server/server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9a500b4

Please sign in to comment.