Add detailed examples and extend schema definitions for Workfeed configurations:

- Introduced examples for `WorkfeedConfigResponse` to demonstrate configurations like `enabled`, `api_url`, `api_key`, and `CompanyID`.
- Split `WorkfeedConfigEntry` into specific schema components with updated discriminator logic for easier validation and understanding.
- Enhanced OpenAPI documentation for `Workfeed` module configuration endpoints.
This commit is contained in:
Jeppe Bundgaard
2026-03-24 10:56:45 +01:00
parent 2903cdf57d
commit 0949d861f9
+90 -7
View File
@@ -8640,6 +8640,30 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/WorkfeedConfigListResponse'
examples:
default:
summary: Workfeed module configuration
value:
success: true
data:
- module: workfeed
variable: enabled
type: bool
value: true
- module: workfeed
variable: api_url
type: string
value: https://api.workfeed.io
- module: workfeed
variable: api_key
type: string
value: wf_live_xxxxxxxxxxxxxxxxx
- module: workfeed
variable: CompanyID
type: string
value: "123456"
meta: []
includes: []
post:
tags: [Config]
summary: Update Workfeed config
@@ -10106,18 +10130,56 @@ components:
- type: string
required: [module, variable, type, value]
WorkfeedConfigEntry:
WorkfeedConfigEnabledEntry:
type: object
properties:
module: { type: string, enum: [workfeed] }
variable: { type: string, enum: [enabled, api_url, api_key] }
type: { type: string, enum: [bool, string] }
value:
oneOf:
- type: boolean
- type: string
variable: { type: string, enum: [enabled] }
type: { type: string, enum: [bool] }
value: { type: boolean }
required: [module, variable, type, value]
WorkfeedConfigApiUrlEntry:
type: object
properties:
module: { type: string, enum: [workfeed] }
variable: { type: string, enum: [api_url] }
type: { type: string, enum: [string] }
value: { type: string, example: "https://api.workfeed.io" }
required: [module, variable, type, value]
WorkfeedConfigApiKeyEntry:
type: object
properties:
module: { type: string, enum: [workfeed] }
variable: { type: string, enum: [api_key] }
type: { type: string, enum: [string] }
value: { type: string, example: "wf_live_xxxxxxxxxxxxxxxxx" }
required: [module, variable, type, value]
WorkfeedConfigCompanyIdEntry:
type: object
properties:
module: { type: string, enum: [workfeed] }
variable: { type: string, enum: [CompanyID] }
type: { type: string, enum: [string] }
value: { type: string, example: "123456" }
required: [module, variable, type, value]
WorkfeedConfigEntry:
oneOf:
- $ref: '#/components/schemas/WorkfeedConfigEnabledEntry'
- $ref: '#/components/schemas/WorkfeedConfigApiUrlEntry'
- $ref: '#/components/schemas/WorkfeedConfigApiKeyEntry'
- $ref: '#/components/schemas/WorkfeedConfigCompanyIdEntry'
discriminator:
propertyName: variable
mapping:
enabled: '#/components/schemas/WorkfeedConfigEnabledEntry'
api_url: '#/components/schemas/WorkfeedConfigApiUrlEntry'
api_key: '#/components/schemas/WorkfeedConfigApiKeyEntry'
CompanyID: '#/components/schemas/WorkfeedConfigCompanyIdEntry'
GatewayApiConfigEntry:
type: object
properties:
@@ -10319,6 +10381,27 @@ components:
properties:
data: { type: array, items: { $ref: '#/components/schemas/WorkfeedConfigEntry' } }
required: [data]
example:
success: true
data:
- module: workfeed
variable: enabled
type: bool
value: true
- module: workfeed
variable: api_url
type: string
value: https://api.workfeed.io
- module: workfeed
variable: api_key
type: string
value: wf_live_xxxxxxxxxxxxxxxxx
- module: workfeed
variable: CompanyID
type: string
value: "123456"
meta: []
includes: []
GatewayApiConfigListResponse:
allOf: