Skip to content

Commit 4c71610

Browse files
committed
Update schema for stomp endpoint
1 parent 6f6b606 commit 4c71610

4 files changed

Lines changed: 62 additions & 18 deletions

File tree

docs/reference/openapi.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
components:
22
schemas:
3+
BasicAuthentication:
4+
additionalProperties: false
5+
description: User credentials for basic authentication
6+
properties:
7+
password:
8+
description: Password to verify user's identity
9+
title: Password
10+
type: string
11+
username:
12+
description: Unique identifier for user
13+
title: Username
14+
type: string
15+
required:
16+
- username
17+
- password
18+
title: BasicAuthentication
19+
type: object
320
DeviceModel:
421
additionalProperties: false
522
description: Representation of a device
@@ -224,6 +241,28 @@ components:
224241
- new_state
225242
title: StateChangeRequest
226243
type: object
244+
StompConfig:
245+
additionalProperties: false
246+
description: Config for connecting to stomp broker
247+
properties:
248+
auth:
249+
$ref: '#/components/schemas/BasicAuthentication'
250+
description: Auth information for communicating with STOMP broker, if required
251+
title: Auth
252+
enabled:
253+
default: false
254+
description: True if blueapi should connect to stomp for asynchronous event
255+
publishing
256+
title: Enabled
257+
type: boolean
258+
url:
259+
default: tcp://localhost:61613
260+
format: uri
261+
minLength: 1
262+
title: Url
263+
type: string
264+
title: StompConfig
265+
type: object
227266
Task:
228267
additionalProperties: false
229268
description: Task that will run a plan
@@ -401,6 +440,22 @@ paths:
401440
summary: Get Oidc Config
402441
tags:
403442
- Meta
443+
/config/stomp:
444+
get:
445+
description: Retrieve the stomp configuration for the server.
446+
operationId: get_stomp_config_config_stomp_get
447+
responses:
448+
'200':
449+
content:
450+
application/json:
451+
schema:
452+
$ref: '#/components/schemas/StompConfig'
453+
description: Successful Response
454+
'204':
455+
description: No Stomp configured
456+
summary: Get Stomp Config
457+
tags:
458+
- Meta
404459
/devices:
405460
get:
406461
description: Retrieve information about all available devices.

helm/blueapi/config_schema.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -453,16 +453,10 @@
453453
"type": "string"
454454
},
455455
"auth": {
456-
"anyOf": [
457-
{
458-
"$ref": "BasicAuthentication"
459-
},
460-
{
461-
"type": "null"
462-
}
463-
],
456+
"$ref": "BasicAuthentication",
464457
"default": null,
465-
"description": "Auth information for communicating with STOMP broker, if required"
458+
"description": "Auth information for communicating with STOMP broker, if required",
459+
"title": "Auth"
466460
}
467461
},
468462
"title": "StompConfig",

helm/blueapi/values.schema.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -862,15 +862,9 @@
862862
"type": "object",
863863
"properties": {
864864
"auth": {
865+
"title": "Auth",
865866
"description": "Auth information for communicating with STOMP broker, if required",
866-
"anyOf": [
867-
{
868-
"$ref": "BasicAuthentication"
869-
},
870-
{
871-
"type": "null"
872-
}
873-
]
867+
"$ref": "BasicAuthentication"
874868
},
875869
"enabled": {
876870
"title": "Enabled",

src/blueapi/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
ValidationError,
2222
field_validator,
2323
)
24+
from pydantic.json_schema import SkipJsonSchema
2425

2526
from blueapi.utils import BlueapiBaseModel, InvalidConfigError
2627

@@ -100,7 +101,7 @@ class StompConfig(BlueapiBaseModel):
100101
default=False,
101102
)
102103
url: TcpUrl = TcpUrl("tcp://localhost:61613")
103-
auth: BasicAuthentication | None = Field(
104+
auth: BasicAuthentication | SkipJsonSchema[None] = Field(
104105
description="Auth information for communicating with STOMP broker, if required",
105106
default=None,
106107
)

0 commit comments

Comments
 (0)