From code review of PR #15.
GET /api/v1/collections/{name} returns skills_json as a JSON-encoded string inside JSON, which is awkward for API consumers:
{"skills_json": "[{\"name\":\"s1\",\"image\":\"quay.io/org/s1:1.0.0\"}]"}
Should return parsed structure:
{"skills": [{"name": "s1", "image": "quay.io/org/s1:1.0.0"}]}
Options:
- Add a
Skills []SkillRef field to Collection with custom MarshalJSON
- Or use a response DTO that parses
skills_json before serialization
Files: internal/store/store.go, internal/handler/collections.go
From code review of PR #15.
GET /api/v1/collections/{name}returnsskills_jsonas a JSON-encoded string inside JSON, which is awkward for API consumers:{"skills_json": "[{\"name\":\"s1\",\"image\":\"quay.io/org/s1:1.0.0\"}]"}Should return parsed structure:
{"skills": [{"name": "s1", "image": "quay.io/org/s1:1.0.0"}]}Options:
Skills []SkillReffield toCollectionwith customMarshalJSONskills_jsonbefore serializationFiles:
internal/store/store.go,internal/handler/collections.go