Skip to content

Commit 349ba42

Browse files
committed
update swagger.json
1 parent 8293b68 commit 349ba42

File tree

1 file changed

+310
-6
lines changed

1 file changed

+310
-6
lines changed

docs/swagger.json

Lines changed: 310 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,46 @@
1616
]
1717
}
1818
},
19+
"/delete/{filename}": {
20+
"parameters": [
21+
{
22+
"name": "filename",
23+
"in": "path",
24+
"required": true,
25+
"type": "string"
26+
}
27+
],
28+
"delete": {
29+
"responses": {
30+
"500": {
31+
"description": "Error occurred while deleting file"
32+
},
33+
"404": {
34+
"description": "File not found"
35+
},
36+
"403": {
37+
"description": "Forbidden - Cannot delete outside data directory"
38+
},
39+
"200": {
40+
"description": "File deleted successfully"
41+
}
42+
},
43+
"summary": "Delete a file from the data directory",
44+
"operationId": "delete_delete_file",
45+
"parameters": [
46+
{
47+
"name": "filename",
48+
"in": "query",
49+
"required": true,
50+
"type": "string",
51+
"description": "The file path relative to the data directory"
52+
}
53+
],
54+
"tags": [
55+
"default"
56+
]
57+
}
58+
},
1959
"/download/{filename}": {
2060
"parameters": [
2161
{
@@ -50,6 +90,61 @@
5090
]
5191
}
5292
},
93+
"/file_list": {
94+
"get": {
95+
"responses": {
96+
"404": {
97+
"description": "Directory not found"
98+
},
99+
"403": {
100+
"description": "Forbidden - Cannot access directory outside data directory"
101+
},
102+
"200": {
103+
"description": "File list retrieved successfully"
104+
}
105+
},
106+
"summary": "Get a list of all files in the specified directory",
107+
"operationId": "get_file_list",
108+
"parameters": [
109+
{
110+
"required": false,
111+
"in": "query",
112+
"description": "The folder path to list (relative to data directory)",
113+
"name": "folder",
114+
"type": "string"
115+
}
116+
],
117+
"tags": [
118+
"default"
119+
]
120+
}
121+
},
122+
"/logs": {
123+
"get": {
124+
"responses": {
125+
"200": {
126+
"description": "Log messages retrieved successfully"
127+
}
128+
},
129+
"summary": "Retrieve the log messages",
130+
"operationId": "get_log_messages",
131+
"tags": [
132+
"default"
133+
]
134+
},
135+
"delete": {
136+
"responses": {
137+
"200": {
138+
"description": "Log messages cleared successfully"
139+
}
140+
},
141+
"summary": "Clear the log messages",
142+
"operationId": "delete_log_messages",
143+
"tags": [
144+
"default"
145+
]
146+
}
147+
},
53148
"/save": {
54149
"post": {
55150
"responses": {
@@ -87,8 +182,34 @@
87182
"description": "Image retrieved successfully"
88183
}
89184
},
90-
"summary": "Retrieve the captured image as a PNG file",
185+
"summary": "Retrieve the captured image as a PNG file with display options",
91186
"operationId": "get_show_image",
187+
"parameters": [
188+
{
189+
"type": "integer",
190+
"in": "query",
191+
"description": "Contrast stretch percentage",
192+
"name": "stretch"
193+
},
194+
{
195+
"type": "string",
196+
"in": "query",
197+
"description": "Band to display (rgb, red, green, blue, nir)",
198+
"name": "band"
199+
},
200+
{
201+
"type": "boolean",
202+
"in": "query",
203+
"description": "Apply robust contrast stretching",
204+
"name": "robust"
205+
},
206+
{
207+
"type": "boolean",
208+
"in": "query",
209+
"description": "Apply histogram equalization",
210+
"name": "hist_eq"
211+
}
212+
],
92213
"tags": [
93214
"default"
94215
]
@@ -121,16 +242,117 @@
121242
"description": "Settings updated successfully"
122243
}
123244
},
124-
"summary": "Update the camera settings",
245+
"summary": "Update camera settings (both basic and advanced)",
246+
"description": "This endpoint handles both the basic settings (n_lines, exposure_ms, processing_lvl)\nand the advanced detailed settings for the camera.\n\nAdvanced settings include:\n- row_slice: Range of rows to read from detector [start, end]\n- resolution: Image resolution [height, width]\n- fwhm_nm: Full Width at Half Maximum (spectral resolution) in nanometers\n- exposure_ms: Exposure time in milliseconds\n- luminance: Luminance value for calibration\n- binxy: Binning factors [x, y]\n- win_offset: Window offset [x, y]\n- win_resolution: Window resolution [width, height]\n- pixel_format: Pixel format (Mono8, Mono12, or Mono16)",
125247
"operationId": "post_update_settings",
126248
"parameters": [
127249
{
128250
"name": "payload",
129251
"required": true,
130252
"in": "body",
131253
"schema": {
132-
"$ref": "#/definitions/Settings"
254+
"$ref": "#/definitions/FullSettings"
133255
}
256+
},
257+
{
258+
"description": "Number of scan lines to capture",
259+
"name": "n_lines",
260+
"type": "string",
261+
"in": "query"
262+
},
263+
{
264+
"description": "Exposure time in milliseconds",
265+
"name": "exposure_ms",
266+
"type": "string",
267+
"in": "query"
268+
},
269+
{
270+
"description": "Processing level (-1 to 4)",
271+
"name": "processing_lvl",
272+
"type": "string",
273+
"in": "query"
274+
},
275+
{
276+
"description": "Range of rows to read from detector [start, end]",
277+
"name": "row_slice",
278+
"type": "string",
279+
"in": "query"
280+
},
281+
{
282+
"description": "Image resolution [height, width]",
283+
"name": "resolution",
284+
"type": "string",
285+
"in": "query"
286+
},
287+
{
288+
"description": "Full Width at Half Maximum (spectral resolution) in nanometers",
289+
"name": "fwhm_nm",
290+
"type": "string",
291+
"in": "query"
292+
},
293+
{
294+
"description": "Luminance value for calibration",
295+
"name": "luminance",
296+
"type": "string",
297+
"in": "query"
298+
},
299+
{
300+
"description": "Binning factors [x, y]",
301+
"name": "binxy",
302+
"type": "string",
303+
"in": "query"
304+
},
305+
{
306+
"description": "Window offset [x, y]",
307+
"name": "win_offset",
308+
"type": "string",
309+
"in": "query"
310+
},
311+
{
312+
"description": "Window resolution [width, height]",
313+
"name": "win_resolution",
314+
"type": "string",
315+
"in": "query"
316+
},
317+
{
318+
"description": "Pixel format (Mono8, Mono12, or Mono16)",
319+
"name": "pixel_format",
320+
"type": "string",
321+
"in": "query"
322+
}
323+
],
324+
"tags": [
325+
"default"
326+
]
327+
}
328+
},
329+
"/view/{filename}": {
330+
"parameters": [
331+
{
332+
"name": "filename",
333+
"in": "path",
334+
"required": true,
335+
"type": "string"
336+
}
337+
],
338+
"get": {
339+
"responses": {
340+
"404": {
341+
"description": "File not found"
342+
},
343+
"200": {
344+
"description": "File sent for viewing"
345+
}
346+
},
347+
"summary": "View a file (especially images) in the browser without downloading",
348+
"operationId": "get_view_file",
349+
"parameters": [
350+
{
351+
"name": "filename",
352+
"in": "query",
353+
"required": true,
354+
"type": "string",
355+
"description": "The file path relative to the data directory"
134356
}
135357
],
136358
"tags": [
@@ -140,9 +362,9 @@
140362
}
141363
},
142364
"info": {
143-
"title": "Camera Capture API",
144-
"version": "1.0",
145-
"description": "API for managing camera capture and file operations"
365+
"title": "OpenHSI Capture API",
366+
"version": "1.1",
367+
"description": "API for managing OpenHSI capture and file operations"
146368
},
147369
"produces": [
148370
"application/json"
@@ -157,6 +379,88 @@
157379
}
158380
],
159381
"definitions": {
382+
"FullSettings": {
383+
"allOf": [
384+
{
385+
"$ref": "#/definitions/Settings"
386+
},
387+
{
388+
"properties": {
389+
"row_slice": {
390+
"type": "array",
391+
"description": "Range of rows to read from detector [start, end]",
392+
"example": [
393+
8,
394+
913
395+
],
396+
"items": {
397+
"type": "integer"
398+
}
399+
},
400+
"resolution": {
401+
"type": "array",
402+
"description": "Image resolution [height, width]",
403+
"example": [
404+
924,
405+
1240
406+
],
407+
"items": {
408+
"type": "integer"
409+
}
410+
},
411+
"fwhm_nm": {
412+
"type": "number",
413+
"description": "Full Width at Half Maximum (spectral resolution) in nanometers",
414+
"example": 4.0
415+
},
416+
"luminance": {
417+
"type": "number",
418+
"description": "Luminance value for calibration",
419+
"example": 10000
420+
},
421+
"binxy": {
422+
"type": "array",
423+
"description": "Binning factors [x, y]",
424+
"example": [
425+
1,
426+
1
427+
],
428+
"items": {
429+
"type": "integer"
430+
}
431+
},
432+
"win_offset": {
433+
"type": "array",
434+
"description": "Window offset [x, y]",
435+
"example": [
436+
96,
437+
200
438+
],
439+
"items": {
440+
"type": "integer"
441+
}
442+
},
443+
"win_resolution": {
444+
"type": "array",
445+
"description": "Window resolution [width, height]",
446+
"example": [
447+
924,
448+
1240
449+
],
450+
"items": {
451+
"type": "integer"
452+
}
453+
},
454+
"pixel_format": {
455+
"type": "string",
456+
"description": "Pixel format (Mono8, Mono12, or Mono16)",
457+
"example": "Mono8"
458+
}
459+
},
460+
"type": "object"
461+
}
462+
]
463+
},
160464
"Settings": {
161465
"properties": {
162466
"n_lines": {

0 commit comments

Comments
 (0)