Skip to content

Commit 7342300

Browse files
committed
Fix: Add missing Swagger annotations for identity path parameters (fixes #1528)
Signed-off-by: Deekshit S <[email protected]>
1 parent f67a468 commit 7342300

File tree

5 files changed

+63
-0
lines changed

5 files changed

+63
-0
lines changed

internal/apiserver/route_get_identity_by_id.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ import (
2525
"github.com/hyperledger/firefly/pkg/core"
2626
)
2727

28+
// @Summary Get identity by ID
29+
// @ID getIdentityByID
30+
// @Tags identities
31+
// @Produce json
32+
// @Param iid path string true "Identity ID"
33+
// @Success 200 {object} core.Identity
34+
// @Router /identities/{iid} [get]
2835
var getIdentityByID = &ffapi.Route{
2936
Name: "getIdentityByID",
3037
Path: "identities/{iid}",

internal/apiserver/route_patch_update_identity.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ import (
2525
"github.com/hyperledger/firefly/pkg/core"
2626
)
2727

28+
// @Summary Update an identity
29+
// @ID patchUpdateIdentity
30+
// @Tags identities
31+
// @Accept json
32+
// @Produce json
33+
// @Param iid path string true "Identity ID" <-- THE CRITICAL FIX
34+
// @Param body body core.IdentityUpdateDTO true "Identity update details"
35+
// @Success 202 {object} core.Identity
36+
// @Router /identities/{iid} [patch]
2837
var patchUpdateIdentity = &ffapi.Route{
2938
Name: "patchUpdateIdentity",
3039
Path: "identities/{iid}",

internal/swagger/docs.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Package swagger Code generated by swaggo/swag at 2025-10-10 07:17:54.1777731 +0530 IST m=+84.795132601. DO NOT EDIT
2+
package swagger
3+
4+
import "github.com/swaggo/swag"
5+
6+
const docTemplate = `{
7+
"schemes": {{ marshal .Schemes }},
8+
"swagger": "2.0",
9+
"info": {
10+
"description": "{{escape .Description}}",
11+
"title": "{{.Title}}",
12+
"contact": {},
13+
"version": "{{.Version}}"
14+
},
15+
"host": "{{.Host}}",
16+
"basePath": "{{.BasePath}}",
17+
"paths": {}
18+
}`
19+
20+
// SwaggerInfo holds exported Swagger Info so clients can modify it
21+
var SwaggerInfo = &swag.Spec{
22+
Version: "",
23+
Host: "",
24+
BasePath: "",
25+
Schemes: []string{},
26+
Title: "",
27+
Description: "",
28+
InfoInstanceName: "swagger",
29+
SwaggerTemplate: docTemplate,
30+
LeftDelim: "{{",
31+
RightDelim: "}}",
32+
}
33+
34+
func init() {
35+
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
36+
}

internal/swagger/swagger.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"contact": {}
5+
},
6+
"paths": {}
7+
}

internal/swagger/swagger.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
info:
2+
contact: {}
3+
paths: {}
4+
swagger: "2.0"

0 commit comments

Comments
 (0)