diff --git a/internal/api/openapi.yaml b/internal/api/openapi.yaml
index 12b7f88..d5a5b5c 100644
--- a/internal/api/openapi.yaml
+++ b/internal/api/openapi.yaml
@@ -506,12 +506,15 @@
"type": "array"
},
"code": {
+ "description": "HTTP status code",
"type": "integer"
},
"err": {
- "$ref": "#/components/schemas/error"
+ "$ref": "#/components/schemas/error",
+ "description": "Unexported field for internal tracking"
},
"fixes": {
+ "description": "suggestions for how to fix",
"items": {
"type": "string"
},
@@ -543,6 +546,7 @@
"Module": {
"properties": {
"commitTime": {
+ "description": "CommitTime is the timestamp returned by the module proxy's .info endpoint,\nrepresenting the time the version was created.",
"format": "date-time",
"type": "string"
},
@@ -595,12 +599,15 @@
"type": "string"
},
"hasGoMod": {
+ "description": "module has go.mod file?",
"type": "boolean"
},
"isRedistributable": {
+ "description": "license allows distribution?",
"type": "boolean"
},
"latestVersion": {
+ "description": "latest unretracted version",
"type": "string"
},
"modulePath": {
@@ -673,6 +680,7 @@
"PackageInfo": {
"properties": {
"isRedistributable": {
+ "description": "license allows distribution?",
"type": "boolean"
},
"name": {
diff --git a/internal/api/openapi_test.go b/internal/api/openapi_test.go
index 0e33a12..e8a58ae 100644
--- a/internal/api/openapi_test.go
+++ b/internal/api/openapi_test.go
@@ -345,7 +345,13 @@
}
typeStr := typeExprToString(field.Type)
- properties[jsonName] = mapFieldType(typeStr)
+ prop := mapFieldType(typeStr)
+ if field.Doc != nil {
+ prop["description"] = strings.TrimSpace(field.Doc.Text())
+ } else if field.Comment != nil {
+ prop["description"] = strings.TrimSpace(field.Comment.Text())
+ }
+ properties[jsonName] = prop
}
schemas[typeName] = map[string]any{