diff options
author | Meisam <39205857+MFTabriz@users.noreply.github.com> | 2022-12-17 07:22:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-17 01:22:34 -0500 |
commit | f3370eeaeefecdcc06940edd0377264a5c0c7212 (patch) | |
tree | 54369a301acb00acd7fb5dc77d466f563247e3eb /tests/integration/api_nodeinfo_test.go | |
parent | c4c4151f7d7a6aa18b354ae45c6ed93570d5de77 (diff) | |
download | gitea-f3370eeaeefecdcc06940edd0377264a5c0c7212.tar.gz gitea-f3370eeaeefecdcc06940edd0377264a5c0c7212.zip |
verify nodeinfo response by schema (#22137)
... using
[github.com/xeipuuv/gojsonschema](https://github.com/xeipuuv/gojsonschema)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'tests/integration/api_nodeinfo_test.go')
-rw-r--r-- | tests/integration/api_nodeinfo_test.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/integration/api_nodeinfo_test.go b/tests/integration/api_nodeinfo_test.go index a7313f3b2c..6e80ebc19c 100644 --- a/tests/integration/api_nodeinfo_test.go +++ b/tests/integration/api_nodeinfo_test.go @@ -27,6 +27,8 @@ func TestNodeinfo(t *testing.T) { onGiteaRun(t, func(*testing.T, *url.URL) { req := NewRequestf(t, "GET", "/api/v1/nodeinfo") resp := MakeRequest(t, req, http.StatusOK) + VerifyJSONSchema(t, resp, "nodeinfo_2.1.json") + var nodeinfo api.NodeInfo DecodeJSON(t, resp, &nodeinfo) assert.True(t, nodeinfo.OpenRegistrations) |