mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	verify nodeinfo response by schema (#22137)
... using [github.com/xeipuuv/gojsonschema](https://github.com/xeipuuv/gojsonschema) Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user