Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Allow tool to be downloaded without index
  • Loading branch information
matteosuppo committed Mar 29, 2019
commit 37e1126ab6dbb4a394f6f9b188bc7f83988f88ee
9 changes: 8 additions & 1 deletion design/pkgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ var IndexPayload = Type("arduino.index", func() {
})

var ToolPayload = Type("arduino.tool", func() {
Description("A tool is an executable program that can upload sketches.")
Description(`A tool is an executable program that can upload sketches.
If url is absent the tool will be searched among the package index installed`)
TypeName("ToolPayload")

Attribute("name", String, "The name of the tool", func() {
Expand All @@ -99,6 +100,12 @@ var ToolPayload = Type("arduino.tool", func() {
Example("arduino")
})

Attribute("url", String, `The url where the package can be found. Optional.
If present checksum must also be present.`)

Attribute("checksum", String, `A checksum of the archive. Mandatory when url is present.
This ensures that the package is downloaded correcly.`)

Required("name", "version", "packager")
})

Expand Down
12 changes: 9 additions & 3 deletions 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.

64 changes: 52 additions & 12 deletions gen/http/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ paths:
type: array
items:
type: string
example: Qui magnam saepe quisquam.
example: Harum nostrum qui ipsa minima quia dolorem.
"400":
description: Bad Request response.
schema:
Expand Down Expand Up @@ -160,6 +160,11 @@ paths:
description: The version of the tool
required: true
type: string
- name: RemoveRequestBody
in: body
required: true
schema:
$ref: '#/definitions/ToolsRemoveRequestBody'
responses:
"200":
description: OK response.
Expand Down Expand Up @@ -215,7 +220,7 @@ definitions:
temporary:
type: boolean
description: Is the error temporary?
example: true
example: false
timeout:
type: boolean
description: Is the error a timeout?
Expand All @@ -226,8 +231,8 @@ definitions:
id: 123abc
message: parameter 'p' must be an integer
name: bad_request
temporary: false
timeout: false
temporary: true
timeout: true
required:
- name
- id
Expand All @@ -242,7 +247,7 @@ definitions:
fault:
type: boolean
description: Is the error a server-side fault?
example: false
example: true
id:
type: string
description: ID is a unique identifier for this particular occurrence of the
Expand All @@ -264,15 +269,15 @@ definitions:
timeout:
type: boolean
description: Is the error a timeout?
example: true
example: false
description: url invalid (default view)
example:
fault: true
fault: false
id: 123abc
message: parameter 'p' must be an integer
name: bad_request
temporary: true
timeout: true
temporary: false
timeout: false
required:
- name
- id
Expand All @@ -287,7 +292,7 @@ definitions:
fault:
type: boolean
description: Is the error a server-side fault?
example: true
example: false
id:
type: string
description: ID is a unique identifier for this particular occurrence of the
Expand All @@ -312,11 +317,11 @@ definitions:
example: true
description: url invalid (default view)
example:
fault: true
fault: false
id: 123abc
message: parameter 'p' must be an integer
name: bad_request
temporary: false
temporary: true
timeout: false
required:
- name
Expand Down Expand Up @@ -355,6 +360,11 @@ definitions:
title: ToolsInstallRequestBody
type: object
properties:
checksum:
type: string
description: "A checksum of the archive. Mandatory when url is present. \n\tThis
ensures that the package is downloaded correcly."
example: Occaecati eum.
name:
type: string
description: The name of the tool
Expand All @@ -363,18 +373,42 @@ definitions:
type: string
description: The packager of the tool
example: arduino
url:
type: string
description: "The url where the package can be found. Optional. \n\tIf present
checksum must also be present."
example: Sit quod dolor repellat.
version:
type: string
description: The version of the tool
example: 6.3.0-arduino9
example:
checksum: Id ut totam.
name: avrdude
packager: arduino
url: Vero ipsum corporis nihil.
version: 6.3.0-arduino9
required:
- name
- version
- packager
ToolsRemoveRequestBody:
title: ToolsRemoveRequestBody
type: object
properties:
checksum:
type: string
description: "A checksum of the archive. Mandatory when url is present. \n\tThis
ensures that the package is downloaded correcly."
example: Nobis officia optio inventore.
url:
type: string
description: "The url where the package can be found. Optional. \n\tIf present
checksum must also be present."
example: Inventore exercitationem.
example:
checksum: Qui modi dolorem.
url: In voluptatibus.
ToolsToolResponseCollection:
title: 'Mediatype identifier: application/vnd.arduino.tool; type=collection; view=default'
type: array
Expand All @@ -389,3 +423,9 @@ definitions:
- name: avrdude
packager: arduino
version: 6.3.0-arduino9
- name: avrdude
packager: arduino
version: 6.3.0-arduino9
- name: avrdude
packager: arduino
version: 6.3.0-arduino9
29 changes: 22 additions & 7 deletions gen/http/tools/client/cli.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/client.go

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

16 changes: 16 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.

29 changes: 29 additions & 0 deletions gen/http/tools/client/types.go

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

14 changes: 13 additions & 1 deletion gen/http/tools/server/encode_decode.go

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

Loading