Added a SQL-Preprocessor - this way we can unmarshal recursive structures (LEFT JOIN etc)

This commit is contained in:
2022-12-21 18:14:13 +01:00
parent bbf7962e29
commit dbc014f819
19 changed files with 740 additions and 162 deletions

View File

@@ -1151,11 +1151,11 @@
},
"/api/users/{uid}/channels": {
"get": {
"description": "The possible values for 'selector' are:\n- \"owned\" Return all channels of the user\n- \"subscribed\" Return all channels that the user is subscribing to\n- \"all\" Return channels that the user owns or is subscribing\n- \"subscribed_any\" Return all channels that the user is subscribing to (even unconfirmed)\n- \"all_any\" Return channels that the user owns or is subscribing (even unconfirmed)",
"description": "The possible values for 'selector' are:\n- \"owned\" Return all channels of the user\n- \"subscribed\" Return all channels that the user is subscribing to\n- \"all\" Return channels that the user owns or is subscribing\n- \"subscribed_any\" Return all channels that the user is subscribing to (even unconfirmed)\n- \"all_any\" Return channels that the user owns or is subscribing (even unconfirmed)",
"tags": [
"API-v2"
],
"summary": "List channels of a user (subscribed/owned)",
"summary": "List channels of a user (subscribed/owned/all)",
"operationId": "api-channels-list",
"parameters": [
{
@@ -1206,9 +1206,7 @@
}
}
}
}
},
"/api/users/{uid}/channels/": {
},
"post": {
"tags": [
"API-v2"
@@ -1236,7 +1234,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.ChannelJSON"
"$ref": "#/definitions/models.ChannelWithSubscriptionJSON"
}
},
"400": {
@@ -1271,7 +1269,7 @@
"tags": [
"API-v2"
],
"summary": "List all channels of a user",
"summary": "Get a single channel",
"operationId": "api-channels-get",
"parameters": [
{
@@ -1293,7 +1291,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.ChannelJSON"
"$ref": "#/definitions/models.ChannelWithSubscriptionJSON"
}
},
"400": {
@@ -1364,7 +1362,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.ChannelJSON"
"$ref": "#/definitions/models.ChannelWithSubscriptionJSON"
}
},
"400": {
@@ -1740,7 +1738,7 @@
"tags": [
"API-v2"
],
"summary": "List all channels of a user",
"summary": "List all subscriptions of a user (incoming/owned)",
"operationId": "api-user-subscriptions-list",
"parameters": [
{
@@ -1749,6 +1747,21 @@
"name": "uid",
"in": "path",
"required": true
},
{
"enum": [
"owner_all",
"owner_confirmed",
"owner_unconfirmed",
"incoming_all",
"incoming_confirmed",
"incoming_unconfirmed"
],
"type": "string",
"description": "Filter subscribptions (default: owner_all)",
"name": "selector",
"in": "query",
"required": true
}
],
"responses": {
@@ -2380,6 +2393,9 @@
"properties": {
"name": {
"type": "string"
},
"subscribe": {
"type": "boolean"
}
}
},
@@ -2529,7 +2545,7 @@
"channels": {
"type": "array",
"items": {
"$ref": "#/definitions/models.ChannelJSON"
"$ref": "#/definitions/models.ChannelWithSubscriptionJSON"
}
}
}
@@ -2804,7 +2820,7 @@
}
}
},
"models.ChannelJSON": {
"models.ChannelWithSubscriptionJSON": {
"type": "object",
"properties": {
"channel_id": {
@@ -2827,6 +2843,9 @@
"description": "can be nil, depending on endpoint",
"type": "string"
},
"subscription": {
"$ref": "#/definitions/models.SubscriptionJSON"
},
"timestamp_created": {
"type": "string"
},

View File

@@ -55,6 +55,8 @@ definitions:
properties:
name:
type: string
subscribe:
type: boolean
type: object
handler.CreateSubscription.body:
properties:
@@ -151,7 +153,7 @@ definitions:
properties:
channels:
items:
$ref: '#/definitions/models.ChannelJSON'
$ref: '#/definitions/models.ChannelWithSubscriptionJSON'
type: array
type: object
handler.ListClients.response:
@@ -334,7 +336,7 @@ definitions:
suppress_send:
type: boolean
type: object
models.ChannelJSON:
models.ChannelWithSubscriptionJSON:
properties:
channel_id:
type: integer
@@ -350,6 +352,8 @@ definitions:
subscribe_key:
description: can be nil, depending on endpoint
type: string
subscription:
$ref: '#/definitions/models.SubscriptionJSON'
timestamp_created:
type: string
timestamp_lastsent:
@@ -1288,11 +1292,11 @@ paths:
get:
description: |-
The possible values for 'selector' are:
- "owned" Return all channels of the user
- "subscribed" Return all channels that the user is subscribing to
- "all" Return channels that the user owns or is subscribing
- "owned" Return all channels of the user
- "subscribed" Return all channels that the user is subscribing to
- "all" Return channels that the user owns or is subscribing
- "subscribed_any" Return all channels that the user is subscribing to (even unconfirmed)
- "all_any" Return channels that the user owns or is subscribing (even unconfirmed)
- "all_any" Return channels that the user owns or is subscribing (even unconfirmed)
operationId: api-channels-list
parameters:
- description: UserID
@@ -1328,10 +1332,9 @@ paths:
description: internal server error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: List channels of a user (subscribed/owned)
summary: List channels of a user (subscribed/owned/all)
tags:
- API-v2
/api/users/{uid}/channels/:
post:
operationId: api-channels-create
parameters:
@@ -1349,7 +1352,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/models.ChannelJSON'
$ref: '#/definitions/models.ChannelWithSubscriptionJSON'
"400":
description: supplied values/parameters cannot be parsed / are invalid
schema:
@@ -1387,7 +1390,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/models.ChannelJSON'
$ref: '#/definitions/models.ChannelWithSubscriptionJSON'
"400":
description: supplied values/parameters cannot be parsed / are invalid
schema:
@@ -1404,7 +1407,7 @@ paths:
description: internal server error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: List all channels of a user
summary: Get a single channel
tags:
- API-v2
patch:
@@ -1434,7 +1437,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/models.ChannelJSON'
$ref: '#/definitions/models.ChannelWithSubscriptionJSON'
"400":
description: supplied values/parameters cannot be parsed / are invalid
schema:
@@ -1693,6 +1696,18 @@ paths:
name: uid
required: true
type: integer
- description: 'Filter subscribptions (default: owner_all)'
enum:
- owner_all
- owner_confirmed
- owner_unconfirmed
- incoming_all
- incoming_confirmed
- incoming_unconfirmed
in: query
name: selector
required: true
type: string
responses:
"200":
description: OK
@@ -1710,7 +1725,7 @@ paths:
description: internal server error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: List all channels of a user
summary: List all subscriptions of a user (incoming/owned)
tags:
- API-v2
post: