mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 09:18:31 +02:00
fix(swagger): explicit set type names for IconFetchResult and IconMetaSearch
This commit is contained in:
@@ -811,7 +811,7 @@
|
|||||||
"schema": {
|
"schema": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/definitions/iconfetch.Result"
|
"$ref": "#/definitions/IconFetchResult"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1698,7 +1698,7 @@
|
|||||||
"schema": {
|
"schema": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/definitions/iconlist.IconMetaSearch"
|
"$ref": "#/definitions/IconMetaSearch"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -3423,6 +3423,69 @@
|
|||||||
"x-nullable": false,
|
"x-nullable": false,
|
||||||
"x-omitempty": false
|
"x-omitempty": false
|
||||||
},
|
},
|
||||||
|
"IconFetchResult": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"icon": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"x-nullable": false,
|
||||||
|
"x-omitempty": false
|
||||||
|
},
|
||||||
|
"statusCode": {
|
||||||
|
"type": "integer",
|
||||||
|
"x-nullable": false,
|
||||||
|
"x-omitempty": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-nullable": false,
|
||||||
|
"x-omitempty": false
|
||||||
|
},
|
||||||
|
"IconMetaSearch": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Dark": {
|
||||||
|
"type": "boolean",
|
||||||
|
"x-nullable": false,
|
||||||
|
"x-omitempty": false
|
||||||
|
},
|
||||||
|
"Light": {
|
||||||
|
"type": "boolean",
|
||||||
|
"x-nullable": false,
|
||||||
|
"x-omitempty": false
|
||||||
|
},
|
||||||
|
"PNG": {
|
||||||
|
"type": "boolean",
|
||||||
|
"x-nullable": false,
|
||||||
|
"x-omitempty": false
|
||||||
|
},
|
||||||
|
"Ref": {
|
||||||
|
"type": "string",
|
||||||
|
"x-nullable": false,
|
||||||
|
"x-omitempty": false
|
||||||
|
},
|
||||||
|
"SVG": {
|
||||||
|
"type": "boolean",
|
||||||
|
"x-nullable": false,
|
||||||
|
"x-omitempty": false
|
||||||
|
},
|
||||||
|
"Source": {
|
||||||
|
"$ref": "#/definitions/icons.Source",
|
||||||
|
"x-nullable": false,
|
||||||
|
"x-omitempty": false
|
||||||
|
},
|
||||||
|
"WebP": {
|
||||||
|
"type": "boolean",
|
||||||
|
"x-nullable": false,
|
||||||
|
"x-omitempty": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-nullable": false,
|
||||||
|
"x-omitempty": false
|
||||||
|
},
|
||||||
"IdlewatcherConfig": {
|
"IdlewatcherConfig": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -3440,7 +3503,7 @@
|
|||||||
"x-omitempty": false
|
"x-omitempty": false
|
||||||
},
|
},
|
||||||
"idle_timeout": {
|
"idle_timeout": {
|
||||||
"description": "0: no idle watcher.\nPositive: idle watcher with idle timeout.\nNegative: idle watcher as a dependency.\tIdleTimeout time.Duration `json:\"idle_timeout\" json_ext:\"duration\"`",
|
"description": "0: no idle watcher.\nPositive: idle watcher with idle timeout.\nNegative: idle watcher as a dependency.",
|
||||||
"allOf": [
|
"allOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/time.Duration"
|
"$ref": "#/definitions/time.Duration"
|
||||||
@@ -5201,69 +5264,6 @@
|
|||||||
"x-nullable": false,
|
"x-nullable": false,
|
||||||
"x-omitempty": false
|
"x-omitempty": false
|
||||||
},
|
},
|
||||||
"iconfetch.Result": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"icon": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "integer",
|
|
||||||
"format": "int32"
|
|
||||||
},
|
|
||||||
"x-nullable": false,
|
|
||||||
"x-omitempty": false
|
|
||||||
},
|
|
||||||
"statusCode": {
|
|
||||||
"type": "integer",
|
|
||||||
"x-nullable": false,
|
|
||||||
"x-omitempty": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-nullable": false,
|
|
||||||
"x-omitempty": false
|
|
||||||
},
|
|
||||||
"iconlist.IconMetaSearch": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"Dark": {
|
|
||||||
"type": "boolean",
|
|
||||||
"x-nullable": false,
|
|
||||||
"x-omitempty": false
|
|
||||||
},
|
|
||||||
"Light": {
|
|
||||||
"type": "boolean",
|
|
||||||
"x-nullable": false,
|
|
||||||
"x-omitempty": false
|
|
||||||
},
|
|
||||||
"PNG": {
|
|
||||||
"type": "boolean",
|
|
||||||
"x-nullable": false,
|
|
||||||
"x-omitempty": false
|
|
||||||
},
|
|
||||||
"Ref": {
|
|
||||||
"type": "string",
|
|
||||||
"x-nullable": false,
|
|
||||||
"x-omitempty": false
|
|
||||||
},
|
|
||||||
"SVG": {
|
|
||||||
"type": "boolean",
|
|
||||||
"x-nullable": false,
|
|
||||||
"x-omitempty": false
|
|
||||||
},
|
|
||||||
"Source": {
|
|
||||||
"$ref": "#/definitions/icons.Source",
|
|
||||||
"x-nullable": false,
|
|
||||||
"x-omitempty": false
|
|
||||||
},
|
|
||||||
"WebP": {
|
|
||||||
"type": "boolean",
|
|
||||||
"x-nullable": false,
|
|
||||||
"x-omitempty": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x-nullable": false,
|
|
||||||
"x-omitempty": false
|
|
||||||
},
|
|
||||||
"icons.Source": {
|
"icons.Source": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
|||||||
@@ -517,6 +517,33 @@ definitions:
|
|||||||
$ref: '#/definitions/HomepageItemConfig'
|
$ref: '#/definitions/HomepageItemConfig'
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
|
IconFetchResult:
|
||||||
|
properties:
|
||||||
|
icon:
|
||||||
|
items:
|
||||||
|
format: int32
|
||||||
|
type: integer
|
||||||
|
type: array
|
||||||
|
statusCode:
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
|
IconMetaSearch:
|
||||||
|
properties:
|
||||||
|
Dark:
|
||||||
|
type: boolean
|
||||||
|
Light:
|
||||||
|
type: boolean
|
||||||
|
PNG:
|
||||||
|
type: boolean
|
||||||
|
Ref:
|
||||||
|
type: string
|
||||||
|
SVG:
|
||||||
|
type: boolean
|
||||||
|
Source:
|
||||||
|
$ref: '#/definitions/icons.Source'
|
||||||
|
WebP:
|
||||||
|
type: boolean
|
||||||
|
type: object
|
||||||
IdlewatcherConfig:
|
IdlewatcherConfig:
|
||||||
properties:
|
properties:
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -528,9 +555,10 @@ definitions:
|
|||||||
idle_timeout:
|
idle_timeout:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/definitions/time.Duration'
|
- $ref: '#/definitions/time.Duration'
|
||||||
description: "0: no idle watcher.\nPositive: idle watcher with idle timeout.\nNegative:
|
description: |-
|
||||||
idle watcher as a dependency.\tIdleTimeout time.Duration `json:\"idle_timeout\"
|
0: no idle watcher.
|
||||||
json_ext:\"duration\"`"
|
Positive: idle watcher with idle timeout.
|
||||||
|
Negative: idle watcher as a dependency.
|
||||||
no_loading_page:
|
no_loading_page:
|
||||||
type: boolean
|
type: boolean
|
||||||
proxmox:
|
proxmox:
|
||||||
@@ -1429,33 +1457,6 @@ definitions:
|
|||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
type: object
|
type: object
|
||||||
iconfetch.Result:
|
|
||||||
properties:
|
|
||||||
icon:
|
|
||||||
items:
|
|
||||||
format: int32
|
|
||||||
type: integer
|
|
||||||
type: array
|
|
||||||
statusCode:
|
|
||||||
type: integer
|
|
||||||
type: object
|
|
||||||
iconlist.IconMetaSearch:
|
|
||||||
properties:
|
|
||||||
Dark:
|
|
||||||
type: boolean
|
|
||||||
Light:
|
|
||||||
type: boolean
|
|
||||||
PNG:
|
|
||||||
type: boolean
|
|
||||||
Ref:
|
|
||||||
type: string
|
|
||||||
SVG:
|
|
||||||
type: boolean
|
|
||||||
Source:
|
|
||||||
$ref: '#/definitions/icons.Source'
|
|
||||||
WebP:
|
|
||||||
type: boolean
|
|
||||||
type: object
|
|
||||||
icons.Source:
|
icons.Source:
|
||||||
enum:
|
enum:
|
||||||
- https://
|
- https://
|
||||||
@@ -2231,7 +2232,7 @@ paths:
|
|||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/iconfetch.Result'
|
$ref: '#/definitions/IconFetchResult'
|
||||||
type: array
|
type: array
|
||||||
"400":
|
"400":
|
||||||
description: 'Bad Request: alias is empty or route is not HTTPRoute'
|
description: 'Bad Request: alias is empty or route is not HTTPRoute'
|
||||||
@@ -2813,7 +2814,7 @@ paths:
|
|||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/iconlist.IconMetaSearch'
|
$ref: '#/definitions/IconMetaSearch'
|
||||||
type: array
|
type: array
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ type Result struct {
|
|||||||
StatusCode int
|
StatusCode int
|
||||||
|
|
||||||
contentType string
|
contentType string
|
||||||
}
|
} // @name IconFetchResult
|
||||||
|
|
||||||
func FetchResultWithErrorf(statusCode int, msgFmt string, args ...any) (Result, error) {
|
func FetchResultWithErrorf(statusCode int, msgFmt string, args ...any) (Result, error) {
|
||||||
return Result{StatusCode: statusCode}, fmt.Errorf(msgFmt, args...)
|
return Result{StatusCode: statusCode}, fmt.Errorf(msgFmt, args...)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ type (
|
|||||||
Ref string `json:"Ref"`
|
Ref string `json:"Ref"`
|
||||||
|
|
||||||
rank int
|
rank int
|
||||||
}
|
} // @name IconMetaSearch
|
||||||
)
|
)
|
||||||
|
|
||||||
const updateInterval = 2 * time.Hour
|
const updateInterval = 2 * time.Hour
|
||||||
|
|||||||
Reference in New Issue
Block a user