mirror of
https://github.com/yibaiba/hideck.git
synced 2026-12-06 16:01:13 +00:00
docs: expose VoWiFi MO SMS readiness in OpenAPI
This commit is contained in:
1 parent
5223100502
commit
5b2aa762a5
2 files changed
+22
No files matched your search
@@ -4150,6 +4150,9 @@ components:
|
||||
type: boolean
|
||||
sms_ready:
|
||||
type: boolean
|
||||
sms_mo_ready:
|
||||
type: boolean
|
||||
description: IMS 短信发送前置条件是否就绪;不依赖用于下行短信的 port-s 接收连接。
|
||||
sms_ready_reason:
|
||||
type: string
|
||||
reg_status:
|
||||
|
||||
@@ -45,6 +45,25 @@ func TestOpenAPIDocumentsPersistentSMSReadState(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestOpenAPIDocumentsVoWiFiMOSMSReadiness(t *testing.T) {
|
||||
data, err := os.ReadFile("openapi.hideck.yaml")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var document map[string]any
|
||||
if err := yaml.Unmarshal(data, &document); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
components := openAPIMap(t, document, "components")
|
||||
schemas := openAPIMap(t, components, "schemas")
|
||||
runtimeSchema := openAPIMap(t, schemas, "VoWiFiRuntime")
|
||||
properties := openAPIMap(t, runtimeSchema, "properties")
|
||||
moReady := openAPIMap(t, properties, "sms_mo_ready")
|
||||
if moReady["type"] != "boolean" {
|
||||
t.Fatalf("OpenAPI VoWiFiRuntime.sms_mo_ready type=%v, want boolean", moReady["type"])
|
||||
}
|
||||
}
|
||||
|
||||
func hasOpenAPIParameter(parameters []any, name string) bool {
|
||||
for _, item := range parameters {
|
||||
parameter, ok := item.(map[string]any)
|
||||
|
||||
Reference in new issue
Block a user