Skip to content

Commit 37e1126

Browse files
committed
Allow tool to be downloaded without index
1 parent 1b22b57 commit 37e1126

File tree

13 files changed

+258
-45
lines changed

13 files changed

+258
-45
lines changed

design/pkgs.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ var IndexPayload = Type("arduino.index", func() {
8686
})
8787

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

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

103+
Attribute("url", String, `The url where the package can be found. Optional.
104+
If present checksum must also be present.`)
105+
106+
Attribute("checksum", String, `A checksum of the archive. Mandatory when url is present.
107+
This ensures that the package is downloaded correcly.`)
108+
102109
Required("name", "version", "packager")
103110
})
104111

gen/http/cli/arduino_create_agent/cli.go

+9-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/http/openapi.json

+1-1
Large diffs are not rendered by default.

gen/http/openapi.yaml

+52-12
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ paths:
3939
type: array
4040
items:
4141
type: string
42-
example: Qui magnam saepe quisquam.
42+
example: Harum nostrum qui ipsa minima quia dolorem.
4343
"400":
4444
description: Bad Request response.
4545
schema:
@@ -160,6 +160,11 @@ paths:
160160
description: The version of the tool
161161
required: true
162162
type: string
163+
- name: RemoveRequestBody
164+
in: body
165+
required: true
166+
schema:
167+
$ref: '#/definitions/ToolsRemoveRequestBody'
163168
responses:
164169
"200":
165170
description: OK response.
@@ -215,7 +220,7 @@ definitions:
215220
temporary:
216221
type: boolean
217222
description: Is the error temporary?
218-
example: true
223+
example: false
219224
timeout:
220225
type: boolean
221226
description: Is the error a timeout?
@@ -226,8 +231,8 @@ definitions:
226231
id: 123abc
227232
message: parameter 'p' must be an integer
228233
name: bad_request
229-
temporary: false
230-
timeout: false
234+
temporary: true
235+
timeout: true
231236
required:
232237
- name
233238
- id
@@ -242,7 +247,7 @@ definitions:
242247
fault:
243248
type: boolean
244249
description: Is the error a server-side fault?
245-
example: false
250+
example: true
246251
id:
247252
type: string
248253
description: ID is a unique identifier for this particular occurrence of the
@@ -264,15 +269,15 @@ definitions:
264269
timeout:
265270
type: boolean
266271
description: Is the error a timeout?
267-
example: true
272+
example: false
268273
description: url invalid (default view)
269274
example:
270-
fault: true
275+
fault: false
271276
id: 123abc
272277
message: parameter 'p' must be an integer
273278
name: bad_request
274-
temporary: true
275-
timeout: true
279+
temporary: false
280+
timeout: false
276281
required:
277282
- name
278283
- id
@@ -287,7 +292,7 @@ definitions:
287292
fault:
288293
type: boolean
289294
description: Is the error a server-side fault?
290-
example: true
295+
example: false
291296
id:
292297
type: string
293298
description: ID is a unique identifier for this particular occurrence of the
@@ -312,11 +317,11 @@ definitions:
312317
example: true
313318
description: url invalid (default view)
314319
example:
315-
fault: true
320+
fault: false
316321
id: 123abc
317322
message: parameter 'p' must be an integer
318323
name: bad_request
319-
temporary: false
324+
temporary: true
320325
timeout: false
321326
required:
322327
- name
@@ -355,6 +360,11 @@ definitions:
355360
title: ToolsInstallRequestBody
356361
type: object
357362
properties:
363+
checksum:
364+
type: string
365+
description: "A checksum of the archive. Mandatory when url is present. \n\tThis
366+
ensures that the package is downloaded correcly."
367+
example: Occaecati eum.
358368
name:
359369
type: string
360370
description: The name of the tool
@@ -363,18 +373,42 @@ definitions:
363373
type: string
364374
description: The packager of the tool
365375
example: arduino
376+
url:
377+
type: string
378+
description: "The url where the package can be found. Optional. \n\tIf present
379+
checksum must also be present."
380+
example: Sit quod dolor repellat.
366381
version:
367382
type: string
368383
description: The version of the tool
369384
example: 6.3.0-arduino9
370385
example:
386+
checksum: Id ut totam.
371387
name: avrdude
372388
packager: arduino
389+
url: Vero ipsum corporis nihil.
373390
version: 6.3.0-arduino9
374391
required:
375392
- name
376393
- version
377394
- packager
395+
ToolsRemoveRequestBody:
396+
title: ToolsRemoveRequestBody
397+
type: object
398+
properties:
399+
checksum:
400+
type: string
401+
description: "A checksum of the archive. Mandatory when url is present. \n\tThis
402+
ensures that the package is downloaded correcly."
403+
example: Nobis officia optio inventore.
404+
url:
405+
type: string
406+
description: "The url where the package can be found. Optional. \n\tIf present
407+
checksum must also be present."
408+
example: Inventore exercitationem.
409+
example:
410+
checksum: Qui modi dolorem.
411+
url: In voluptatibus.
378412
ToolsToolResponseCollection:
379413
title: 'Mediatype identifier: application/vnd.arduino.tool; type=collection; view=default'
380414
type: array
@@ -389,3 +423,9 @@ definitions:
389423
- name: avrdude
390424
packager: arduino
391425
version: 6.3.0-arduino9
426+
- name: avrdude
427+
packager: arduino
428+
version: 6.3.0-arduino9
429+
- name: avrdude
430+
packager: arduino
431+
version: 6.3.0-arduino9

gen/http/tools/client/cli.go

+22-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/http/tools/client/client.go

+5
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

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/http/tools/client/types.go

+29
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

+13-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)