Align WeatherAPI OpenAPI schemas with actual response envelopes

This commit is contained in:
Jeppe B
2026-03-11 14:37:37 +01:00
parent 6713a67eb5
commit 3607aef2ca
8 changed files with 748 additions and 0 deletions
+196
View File
@@ -6470,6 +6470,104 @@ paths:
'200':
description: Exchange rates retrieved successfully
/modules/weatherapi/current:
get:
tags:
- Modules
summary: Get current weather
description: Get current weather data from WeatherAPI for a location query
operationId: weatherApiCurrent
parameters:
- name: q
in: query
required: true
schema:
type: string
description: Location query (e.g. city, postal code, or latitude,longitude)
responses:
'200':
description: Current weather retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/WeatherApiObjectResponse'
/modules/weatherapi/forecast:
get:
tags:
- Modules
summary: Get weather forecast
description: Get forecast weather data from WeatherAPI
operationId: weatherApiForecast
parameters:
- name: q
in: query
required: true
schema:
type: string
description: Location query (e.g. city, postal code, or latitude,longitude)
- name: days
in: query
required: false
schema:
type: integer
minimum: 1
maximum: 14
description: Number of forecast days
responses:
'200':
description: Forecast weather retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/WeatherApiObjectResponse'
/modules/weatherapi/search:
get:
tags:
- Modules
summary: Search weather locations
description: Search location suggestions from WeatherAPI
operationId: weatherApiSearch
parameters:
- name: q
in: query
required: true
schema:
type: string
description: Search text
responses:
'200':
description: Location search results retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/WeatherApiObjectResponse'
/departments/weather:
get:
tags:
- Departments
summary: Get department weather timeline
description: Returns hourly weather, washes, hours and productivity status for a department
operationId: getDepartmentWeatherTimeline
parameters:
- name: id
in: query
required: true
schema:
type: integer
minimum: 1
description: Department ID
responses:
'200':
description: Department weather timeline retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/DepartmentWeatherTimelineResponse'
/modules/entra/users:
get:
tags:
@@ -6923,6 +7021,31 @@ paths:
schema:
$ref: '#/components/schemas/ModuleConfigUpdateResponse'
/weatherapi/config:
get:
tags: [Config]
summary: Get WeatherAPI config
operationId: getWeatherApiConfig
responses:
'200':
description: WeatherAPI configuration retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/WeatherApiConfigListResponse'
post:
tags: [Config]
summary: Update WeatherAPI config
operationId: updateWeatherApiConfig
responses:
'200':
description: WeatherAPI configuration updated successfully
content:
application/json:
schema:
$ref: '#/components/schemas/ModuleConfigUpdateResponse'
/gatewayapi/config:
get:
tags: [Config]
@@ -7898,6 +8021,19 @@ components:
- type: string
required: [module, variable, type, value]
WeatherApiConfigEntry:
type: object
properties:
module: { type: string, enum: [weatherapi] }
variable: { type: string, enum: [enabled, secret_key] }
type: { type: string, enum: [bool, string] }
value:
oneOf:
- type: boolean
- type: string
required: [module, variable, type, value]
GatewayApiConfigEntry:
type: object
properties:
@@ -8083,6 +8219,15 @@ components:
data: { type: array, items: { $ref: '#/components/schemas/FxRatesApiConfigEntry' } }
required: [data]
WeatherApiConfigListResponse:
allOf:
- $ref: '#/components/schemas/ModuleConfigEnvelopeBase'
- type: object
properties:
data: { type: array, items: { $ref: '#/components/schemas/WeatherApiConfigEntry' } }
required: [data]
GatewayApiConfigListResponse:
allOf:
- $ref: '#/components/schemas/ModuleConfigEnvelopeBase'
@@ -8163,6 +8308,57 @@ components:
data: { type: array, items: { $ref: '#/components/schemas/SelfServeConfigEntry' } }
required: [data]
DepartmentWeatherStatus:
type: string
enum: [unknown, healthy, degraded, unhealthy]
DepartmentWeatherCondition:
type: string
enum: [clear, mostly_clear, partly_cloudy, mostly_cloudy, overcast, rain, showers, thunderstorm, snow, fog]
DepartmentWeatherTimelineEntry:
type: object
properties:
time:
type: string
example: '01:00'
weather:
$ref: '#/components/schemas/DepartmentWeatherCondition'
washes:
type: integer
minimum: 0
example: 0
hours:
type: integer
minimum: 0
example: 10
status:
$ref: '#/components/schemas/DepartmentWeatherStatus'
required: [time, weather, washes, hours, status]
WeatherApiObjectResponse:
allOf:
- $ref: '#/components/schemas/ModuleConfigEnvelopeBase'
- type: object
properties:
data:
type: object
additionalProperties: true
required: [data]
DepartmentWeatherTimelineResponse:
allOf:
- $ref: '#/components/schemas/ModuleConfigEnvelopeBase'
- type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/DepartmentWeatherTimelineEntry'
required: [data]
ModuleConfigEntry:
type: object
properties: