MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / TestSchemaBuild

Function TestSchemaBuild

module/ai-api/schema_test.go:11–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestSchemaBuild(t *testing.T) {
12 // TODO
13 doc := genOpenAPI3Template("test", "test")
14 variables := []*ai_api_dto.AiPromptVariable{
15 {
16 Key: "query",
17 Description: "测试参数",
18 Require: true,
19 },
20 }
21 doc.AddOperation("/test", http.MethodPost, genOperation("测试接口", "这是一个测试接口", variables))
22 data, err := doc.MarshalJSON()
23 if err != nil {
24 t.Fatal(err)
25 }
26 fmt.Println(string(data))
27}

Callers

nothing calls this directly

Calls 3

genOpenAPI3TemplateFunction · 0.85
genOperationFunction · 0.85
MarshalJSONMethod · 0.45

Tested by

no test coverage detected