From 9e53b117ea86fcdc57f3305fefc49b87b54ede31 Mon Sep 17 00:00:00 2001 From: Sam Lucidi Date: Thu, 26 Oct 2023 14:22:51 -0400 Subject: [PATCH 1/3] Add missing parameter documentation and API info Necessary to satisfy Swagger/OpenAPI validator. Signed-off-by: Sam Lucidi --- api/adoptionplan.go | 6 +++--- api/analysis.go | 18 +++++++++++------- api/application.go | 29 +++++++++++++++++------------ api/archetype.go | 7 ++++--- api/assessment.go | 6 +++--- api/bucket.go | 13 ++++++++----- api/businessservice.go | 6 +++--- api/cache.go | 4 ++-- api/dependency.go | 4 ++-- api/file.go | 4 ++-- api/group.go | 6 +++--- api/identity.go | 6 +++--- api/import.go | 8 ++++---- api/jobfunction.go | 6 +++--- api/pkg.go | 10 ++++++++++ api/proxy.go | 6 +++--- api/questionnaire.go | 6 +++--- api/review.go | 6 +++--- api/ruleset.go | 6 +++--- api/setting.go | 1 + api/stakeholder.go | 6 +++--- api/tag.go | 6 +++--- api/tagcategory.go | 8 ++++---- api/target.go | 6 +++--- api/task.go | 25 ++++++++++++++----------- api/taskgroup.go | 17 ++++++++++------- api/ticket.go | 2 +- api/tracker.go | 8 ++++---- 28 files changed, 133 insertions(+), 103 deletions(-) diff --git a/api/adoptionplan.go b/api/adoptionplan.go index b7c1f5c44..c36e7d730 100644 --- a/api/adoptionplan.go +++ b/api/adoptionplan.go @@ -37,14 +37,14 @@ func (h AdoptionPlanHandler) AddRoutes(e *gin.Engine) { routeGroup.POST(AdoptionPlansRoot, h.Graph) } -// Get godoc +// Graph godoc // @summary Generate an application dependency graph arranged in topological order. // @description Graph generates an application dependency graph arranged in topological order. // @tags adoptionplans // @produce json -// @success 200 {object} api.DependencyGraph +// @success 200 {object} []api.Vertex // @router /adoptionplans [post] -// @param requestedApps path array true "requested App IDs" +// @param requestedApps body []uint true "List of requested App IDs" func (h AdoptionPlanHandler) Graph(ctx *gin.Context) { var requestedApps []struct { ApplicationID uint `json:"applicationId"` diff --git a/api/analysis.go b/api/analysis.go index e0bc461b7..aa1529d8a 100644 --- a/api/analysis.go +++ b/api/analysis.go @@ -95,7 +95,7 @@ func (h AnalysisHandler) AddRoutes(e *gin.Engine) { // @produce octet-stream // @success 200 {object} api.Analysis // @router /analyses/{id} [get] -// @param id path string true "Analysis ID" +// @param id path int true "Analysis ID" func (h AnalysisHandler) Get(ctx *gin.Context) { id := h.pk(ctx) writer := AnalysisWriter{ctx: ctx} @@ -118,7 +118,7 @@ func (h AnalysisHandler) Get(ctx *gin.Context) { // @produce octet-stream // @success 200 {object} api.Analysis // @router /applications/{id}/analysis [get] -// @param id path string true "Application ID" +// @param id path int true "Application ID" func (h AnalysisHandler) AppLatest(ctx *gin.Context) { id := h.pk(ctx) m := &model.Analysis{} @@ -149,7 +149,7 @@ func (h AnalysisHandler) AppLatest(ctx *gin.Context) { // @produce octet-stream // @success 200 // @router /applications/{id}/analysis/report [get] -// @param id path string true "Application ID" +// @param id path int true "Application ID" func (h AnalysisHandler) AppLatestReport(ctx *gin.Context) { id := h.pk(ctx) m := &model.Analysis{} @@ -229,6 +229,7 @@ func (h AnalysisHandler) AppList(ctx *gin.Context) { // @produce json // @success 201 {object} api.Analysis // @router /application/{id}/analyses [post] +// @param id path int true "Application ID" func (h AnalysisHandler) AppCreate(ctx *gin.Context) { id := h.pk(ctx) result := h.DB(ctx).First(&model.Application{}, id) @@ -398,7 +399,7 @@ func (h AnalysisHandler) AppCreate(ctx *gin.Context) { // @tags analyses // @success 204 // @router /analyses/{id} [delete] -// @param id path string true "Analysis ID" +// @param id path int true "Analysis ID" func (h AnalysisHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) r := &model.Analysis{} @@ -429,7 +430,7 @@ func (h AnalysisHandler) Delete(ctx *gin.Context) { // @produce json // @success 200 {object} []api.TechDependency // @router /application/{id}/analysis/dependencies [get] -// @param id path string true "Application ID" +// @param id path int true "Application ID" func (h AnalysisHandler) AppDeps(ctx *gin.Context) { resources := []TechDependency{} // Latest @@ -511,7 +512,7 @@ func (h AnalysisHandler) AppDeps(ctx *gin.Context) { // @produce json // @success 200 {object} []api.Issue // @router /application/{id}/analysis/issues [get] -// @param id path string true "Application ID" +// @param id path int true "Application ID" func (h AnalysisHandler) AppIssues(ctx *gin.Context) { resources := []Issue{} // Latest @@ -673,6 +674,7 @@ func (h AnalysisHandler) Issues(ctx *gin.Context) { // @produce json // @success 200 {object} api.Issue // @router /analyses/issues/{id} [get] +// @param id path int true "Issue ID" func (h AnalysisHandler) Issue(ctx *gin.Context) { id := h.pk(ctx) m := &model.Issue{} @@ -698,6 +700,7 @@ func (h AnalysisHandler) Issue(ctx *gin.Context) { // @produce json // @success 200 {object} []api.Incident // @router /analyses/issues/{id}/incidents [get] +// @param id path int true "Issue ID" func (h AnalysisHandler) Incidents(ctx *gin.Context) { issueId := ctx.Param(ID) // Filter @@ -900,7 +903,7 @@ func (h AnalysisHandler) RuleReports(ctx *gin.Context) { // @produce json // @success 200 {object} []api.IssueReport // @router /analyses/report/applications/{id}/issues [get] -// @param id path string true "Application ID" +// @param id path int true "Application ID" func (h AnalysisHandler) AppIssueReports(ctx *gin.Context) { resources := []*IssueReport{} type M struct { @@ -1176,6 +1179,7 @@ func (h AnalysisHandler) IssueAppReports(ctx *gin.Context) { // @produce json // @success 200 {object} []api.FileReport // @router /analyses/report/issues/{id}/files [get] +// @param id path int true "Issue ID" func (h AnalysisHandler) FileReports(ctx *gin.Context) { resources := []FileReport{} type M struct { diff --git a/api/application.go b/api/application.go index 93195c5c7..f978dec0a 100644 --- a/api/application.go +++ b/api/application.go @@ -388,7 +388,8 @@ func (h ApplicationHandler) Update(ctx *gin.Context) { // @produce octet-stream // @success 200 // @router /applications/{id}/bucket/{wildcard} [get] -// @param id path string true "Application ID" +// @param id path int true "Application ID" +// @param wildcard path string true "Content path" // @param filter query string false "Filter" func (h ApplicationHandler) BucketGet(ctx *gin.Context) { m := &model.Application{} @@ -413,7 +414,8 @@ func (h ApplicationHandler) BucketGet(ctx *gin.Context) { // @produce json // @success 204 // @router /applications/{id}/bucket/{wildcard} [post] -// @param id path string true "Application ID" +// @param id path int true "Application ID" +// @param wildcard path string true "Content path" func (h ApplicationHandler) BucketPut(ctx *gin.Context) { m := &model.Application{} id := h.pk(ctx) @@ -437,7 +439,8 @@ func (h ApplicationHandler) BucketPut(ctx *gin.Context) { // @produce json // @success 204 // @router /applications/{id}/bucket/{wildcard} [delete] -// @param id path string true "Application ID" +// @param id path int true "Application ID" +// @param wildcard path string true "Content path" func (h ApplicationHandler) BucketDelete(ctx *gin.Context) { m := &model.Application{} id := h.pk(ctx) @@ -461,7 +464,7 @@ func (h ApplicationHandler) BucketDelete(ctx *gin.Context) { // @produce json // @success 200 {object} []api.Ref // @router /applications/{id}/tags [get] -// @param id path string true "Application ID" +// @param id path int true "Application ID" func (h ApplicationHandler) TagList(ctx *gin.Context) { id := h.pk(ctx) app := &model.Application{} @@ -533,6 +536,7 @@ func (h ApplicationHandler) TagList(ctx *gin.Context) { // @success 201 {object} api.Ref // @router /applications/{id}/tags [post] // @param tag body Ref true "Tag data" +// @param id path int true "Application ID" func (h ApplicationHandler) TagAdd(ctx *gin.Context) { id := h.pk(ctx) ref := &TagRef{} @@ -572,7 +576,7 @@ func (h ApplicationHandler) TagAdd(ctx *gin.Context) { // @accept json // @success 204 // @router /applications/{id}/tags [patch] -// @param id path string true "Application ID" +// @param id path int true "Application ID" // @param source query string false "Source" // @param tags body []TagRef true "Tag references" func (h ApplicationHandler) TagReplace(ctx *gin.Context) { @@ -626,7 +630,7 @@ func (h ApplicationHandler) TagReplace(ctx *gin.Context) { // @tags applications // @success 204 // @router /applications/{id}/tags/{sid} [delete] -// @param id path string true "Application ID" +// @param id path int true "Application ID" // @param sid path string true "Tag ID" func (h ApplicationHandler) TagDelete(ctx *gin.Context) { id := h.pk(ctx) @@ -661,7 +665,7 @@ func (h ApplicationHandler) TagDelete(ctx *gin.Context) { // @produce json // @success 200 {object} api.FactMap // @router /applications/{id}/facts/{source}: [get] -// @param id path string true "Application ID" +// @param id path int true "Application ID" // @param source path string true "Source key" func (h ApplicationHandler) FactList(ctx *gin.Context, key FactKey) { id := h.pk(ctx) @@ -693,7 +697,7 @@ func (h ApplicationHandler) FactList(ctx *gin.Context, key FactKey) { // @produce json // @success 200 {object} object // @router /applications/{id}/facts/{key} [get] -// @param id path string true "Application ID" +// @param id path int true "Application ID" // @param key path string true "Fact key" func (h ApplicationHandler) FactGet(ctx *gin.Context) { id := h.pk(ctx) @@ -738,7 +742,7 @@ func (h ApplicationHandler) FactGet(ctx *gin.Context) { // @produce json // @success 201 // @router /applications/{id}/facts [post] -// @param id path string true "Application ID" +// @param id path int true "Application ID" // @param fact body api.Fact true "Fact data" func (h ApplicationHandler) FactCreate(ctx *gin.Context) { id := h.pk(ctx) @@ -775,7 +779,7 @@ func (h ApplicationHandler) FactCreate(ctx *gin.Context) { // @produce json // @success 204 // @router /applications/{id}/facts/{key} [put] -// @param id path string true "Application ID" +// @param id path int true "Application ID" // @param key path string true "Fact key" // @param fact body object true "Fact value" func (h ApplicationHandler) FactPut(ctx *gin.Context) { @@ -822,7 +826,7 @@ func (h ApplicationHandler) FactPut(ctx *gin.Context) { // @tags applications // @success 204 // @router /applications/{id}/facts/{key} [delete] -// @param id path string true "Application ID" +// @param id path int true "Application ID" // @param key path string true "Fact key" func (h ApplicationHandler) FactDelete(ctx *gin.Context) { id := h.pk(ctx) @@ -854,7 +858,7 @@ func (h ApplicationHandler) FactDelete(ctx *gin.Context) { // @tags applications // @success 204 // @router /applications/{id}/facts/{source}: [put] -// @param id path string true "Application ID" +// @param id path int true "Application ID" // @param source path string true "Fact key" // @param factmap body api.FactMap true "Fact map" func (h ApplicationHandler) FactReplace(ctx *gin.Context, key FactKey) { @@ -998,6 +1002,7 @@ func (h ApplicationHandler) AssessmentList(ctx *gin.Context) { // @produce json // @success 201 {object} api.Assessment // @router /applications/{id}/assessments [post] +// @param id path int true "Application ID" // @param assessment body api.Assessment true "Assessment data" func (h ApplicationHandler) AssessmentCreate(ctx *gin.Context) { application := &model.Application{} diff --git a/api/archetype.go b/api/archetype.go index eda389694..4a2e7fc11 100644 --- a/api/archetype.go +++ b/api/archetype.go @@ -47,7 +47,7 @@ func (h ArchetypeHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.Archetype // @router /archetypes/{id} [get] -// @param id path string true "Archetype ID" +// @param id path int true "Archetype ID" func (h ArchetypeHandler) Get(ctx *gin.Context) { m := &model.Archetype{} id := h.pk(ctx) @@ -168,7 +168,7 @@ func (h ArchetypeHandler) Create(ctx *gin.Context) { // @tags archetypes // @success 204 // @router /archetypes/{id} [delete] -// @param id path string true "Archetype ID" +// @param id path int true "Archetype ID" func (h ArchetypeHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) m := &model.Archetype{} @@ -193,7 +193,7 @@ func (h ArchetypeHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /archetypes/{id} [put] -// @param id path string true "Archetype ID" +// @param id path int true "Archetype ID" // @param archetype body api.Archetype true "Archetype data" func (h ArchetypeHandler) Update(ctx *gin.Context) { id := h.pk(ctx) @@ -274,6 +274,7 @@ func (h ArchetypeHandler) AssessmentList(ctx *gin.Context) { // @success 201 {object} api.Assessment // @router /archetypes/{id}/assessments [post] // @param assessment body api.Assessment true "Assessment data" +// @param id path int true "Archetype ID" func (h ArchetypeHandler) AssessmentCreate(ctx *gin.Context) { archetype := &model.Archetype{} id := h.pk(ctx) diff --git a/api/assessment.go b/api/assessment.go index edc4fa843..96f86f36c 100644 --- a/api/assessment.go +++ b/api/assessment.go @@ -41,7 +41,7 @@ func (h AssessmentHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.Assessment // @router /assessments/{id} [get] -// @param id path string true "Assessment ID" +// @param id path int true "Assessment ID" func (h AssessmentHandler) Get(ctx *gin.Context) { m := &model.Assessment{} id := h.pk(ctx) @@ -88,7 +88,7 @@ func (h AssessmentHandler) List(ctx *gin.Context) { // @tags assessments // @success 204 // @router /assessments/{id} [delete] -// @param id path string true "Assessment ID" +// @param id path int true "Assessment ID" func (h AssessmentHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) m := &model.Assessment{} @@ -113,7 +113,7 @@ func (h AssessmentHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /assessments/{id} [put] -// @param id path string true "Assessment ID" +// @param id path int true "Assessment ID" // @param assessment body api.Assessment true "Assessment data" func (h AssessmentHandler) Update(ctx *gin.Context) { id := h.pk(ctx) diff --git a/api/bucket.go b/api/bucket.go index 20483debd..7f504cdcc 100644 --- a/api/bucket.go +++ b/api/bucket.go @@ -99,7 +99,7 @@ func (h BucketHandler) Create(ctx *gin.Context) { // @produce octet-stream // @success 200 {object} api.Bucket // @router /buckets/{id} [get] -// @param id path string true "Bucket ID" +// @param id path int true "Bucket ID" func (h BucketHandler) Get(ctx *gin.Context) { m := &model.Bucket{} id := h.pk(ctx) @@ -123,7 +123,7 @@ func (h BucketHandler) Get(ctx *gin.Context) { // @tags buckets // @success 204 // @router /buckets/{id} [delete] -// @param id path string true "Bucket ID" +// @param id path int true "Bucket ID" func (h BucketHandler) Delete(ctx *gin.Context) { m := &model.Bucket{} id := h.pk(ctx) @@ -159,7 +159,8 @@ func (h BucketHandler) Delete(ctx *gin.Context) { // @produce octet-stream // @success 200 // @router /buckets/{id}/{wildcard} [get] -// @param id path string true "Task ID" +// @param id path int true "Task ID" +// @param wildcard path string true "Content path" // @param filter query string false "Filter" func (h BucketHandler) BucketGet(ctx *gin.Context) { h.bucketGet(ctx, h.pk(ctx)) @@ -172,7 +173,8 @@ func (h BucketHandler) BucketGet(ctx *gin.Context) { // @produce json // @success 204 // @router /buckets/{id}/{wildcard} [post] -// @param id path string true "Bucket ID" +// @param id path int true "Bucket ID" +// @param wildcard path string true "Content path" func (h BucketHandler) BucketPut(ctx *gin.Context) { h.bucketPut(ctx, h.pk(ctx)) } @@ -184,7 +186,8 @@ func (h BucketHandler) BucketPut(ctx *gin.Context) { // @produce json // @success 204 // @router /buckets/{id}/{wildcard} [delete] -// @param id path string true "Bucket ID" +// @param id path int true "Bucket ID" +// @param wildcard path string true "Content path" func (h BucketHandler) BucketDelete(ctx *gin.Context) { h.bucketDelete(ctx, h.pk(ctx)) } diff --git a/api/businessservice.go b/api/businessservice.go index b506ddb06..59407b68d 100644 --- a/api/businessservice.go +++ b/api/businessservice.go @@ -40,7 +40,7 @@ func (h BusinessServiceHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.BusinessService // @router /businessservices/{id} [get] -// @param id path string true "Business Service ID" +// @param id path int true "Business Service ID" func (h BusinessServiceHandler) Get(ctx *gin.Context) { m := &model.BusinessService{} id := h.pk(ctx) @@ -115,7 +115,7 @@ func (h BusinessServiceHandler) Create(ctx *gin.Context) { // @tags businessservices // @success 204 // @router /businessservices/{id} [delete] -// @param id path string true "Business service ID" +// @param id path int true "Business service ID" func (h BusinessServiceHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) m := &model.BusinessService{} @@ -140,7 +140,7 @@ func (h BusinessServiceHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /businessservices/{id} [put] -// @param id path string true "Business service ID" +// @param id path int true "Business service ID" // @param business_service body api.BusinessService true "Business service data" func (h BusinessServiceHandler) Update(ctx *gin.Context) { id := h.pk(ctx) diff --git a/api/cache.go b/api/cache.go index 6426ef8bd..3ade7b329 100644 --- a/api/cache.go +++ b/api/cache.go @@ -40,8 +40,8 @@ func (h CacheHandler) AddRoutes(e *gin.Engine) { // @tags cache // @produce json // @success 200 {object} api.Cache -// @router /caches/{id} [get] -// @param name path string true "Cache DIR" +// @router /caches/{wildcard} [get] +// @param wildcard path string true "Cache DIR" func (h CacheHandler) Get(ctx *gin.Context) { dir := ctx.Param(Wildcard) r, err := h.cache(dir) diff --git a/api/dependency.go b/api/dependency.go index 525a5ec4a..1b4f9cbfb 100644 --- a/api/dependency.go +++ b/api/dependency.go @@ -40,7 +40,7 @@ func (h DependencyHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.Dependency // @router /dependencies/{id} [get] -// @param id path string true "Dependency ID" +// @param id path int true "Dependency ID" func (h DependencyHandler) Get(ctx *gin.Context) { m := &model.Dependency{} id := ctx.Param(ID) @@ -127,7 +127,7 @@ func (h DependencyHandler) Create(ctx *gin.Context) { // @accept json // @success 204 // @router /dependencies/{id} [delete] -// @param id path string true "Dependency id" +// @param id path int true "Dependency id" func (h DependencyHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) m := &model.Dependency{} diff --git a/api/file.go b/api/file.go index c585470c1..932b892fc 100644 --- a/api/file.go +++ b/api/file.go @@ -129,7 +129,7 @@ func (h FileHandler) Create(ctx *gin.Context) { // @produce octet-stream // @success 200 {object} api.File // @router /files/{id} [get] -// @param id path string true "File ID" +// @param id path int true "File ID" func (h FileHandler) Get(ctx *gin.Context) { m := &model.File{} id := h.pk(ctx) @@ -157,7 +157,7 @@ func (h FileHandler) Get(ctx *gin.Context) { // @tags file // @success 204 // @router /files/{id} [delete] -// @param id path string true "File ID" +// @param id path int true "File ID" func (h FileHandler) Delete(ctx *gin.Context) { m := &model.File{} id := h.pk(ctx) diff --git a/api/group.go b/api/group.go index 4d88b067a..6d5ff602b 100644 --- a/api/group.go +++ b/api/group.go @@ -40,7 +40,7 @@ func (h StakeholderGroupHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.StakeholderGroup // @router /stakeholdergroups/{id} [get] -// @param id path string true "Stakeholder Group ID" +// @param id path int true "Stakeholder Group ID" func (h StakeholderGroupHandler) Get(ctx *gin.Context) { id := h.pk(ctx) m := &model.StakeholderGroup{} @@ -115,7 +115,7 @@ func (h StakeholderGroupHandler) Create(ctx *gin.Context) { // @tags stakeholdergroups // @success 204 // @router /stakeholdergroups/{id} [delete] -// @param id path string true "Stakeholder Group ID" +// @param id path int true "Stakeholder Group ID" func (h StakeholderGroupHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) m := &model.StakeholderGroup{} @@ -140,7 +140,7 @@ func (h StakeholderGroupHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /stakeholdergroups/{id} [put] -// @param id path string true "Stakeholder Group ID" +// @param id path int true "Stakeholder Group ID" // @param stakeholder_group body api.StakeholderGroup true "Stakeholder Group data" func (h StakeholderGroupHandler) Update(ctx *gin.Context) { id := h.pk(ctx) diff --git a/api/identity.go b/api/identity.go index b882573ce..363b23982 100644 --- a/api/identity.go +++ b/api/identity.go @@ -45,7 +45,7 @@ func (h IdentityHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} Identity // @router /identities/{id} [get] -// @param id path string true "Identity ID" +// @param id path int true "Identity ID" func (h IdentityHandler) Get(ctx *gin.Context) { id := h.pk(ctx) m := &model.Identity{} @@ -152,7 +152,7 @@ func (h IdentityHandler) Create(ctx *gin.Context) { // @tags identities // @success 204 // @router /identities/{id} [delete] -// @param id path string true "Identity ID" +// @param id path int true "Identity ID" func (h IdentityHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) identity := &model.Identity{} @@ -177,7 +177,7 @@ func (h IdentityHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /identities/{id} [put] -// @param id path string true "Identity ID" +// @param id path int true "Identity ID" // @param identity body Identity true "Identity data" func (h IdentityHandler) Update(ctx *gin.Context) { id := h.pk(ctx) diff --git a/api/import.go b/api/import.go index 17a03b39c..e1fb3ec35 100644 --- a/api/import.go +++ b/api/import.go @@ -67,7 +67,7 @@ func (h ImportHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.Import // @router /imports/{id} [get] -// @param id path string true "Import ID" +// @param id path int true "Import ID" func (h ImportHandler) GetImport(ctx *gin.Context) { m := &model.Import{} id := ctx.Param(ID) @@ -122,7 +122,7 @@ func (h ImportHandler) ListImports(ctx *gin.Context) { // @tags imports // @success 204 // @router /imports/{id} [delete] -// @param id path string true "Import ID" +// @param id path int true "Import ID" func (h ImportHandler) DeleteImport(ctx *gin.Context) { id := ctx.Param(ID) result := h.DB(ctx).Delete(&model.Import{}, id) @@ -142,7 +142,7 @@ func (h ImportHandler) DeleteImport(ctx *gin.Context) { // @produce json // @success 200 {object} api.ImportSummary // @router /importsummaries/{id} [get] -// @param id path string true "ImportSummary ID" +// @param id path int true "ImportSummary ID" func (h ImportHandler) GetSummary(ctx *gin.Context) { m := &model.ImportSummary{} id := ctx.Param(ID) @@ -188,7 +188,7 @@ func (h ImportHandler) ListSummaries(ctx *gin.Context) { // @tags imports // @success 204 // @router /importsummaries/{id} [delete] -// @param id path string true "ImportSummary ID" +// @param id path int true "ImportSummary ID" func (h ImportHandler) DeleteSummary(ctx *gin.Context) { id := ctx.Param(ID) result := h.DB(ctx).Delete(&model.ImportSummary{}, id) diff --git a/api/jobfunction.go b/api/jobfunction.go index e5ce1e0aa..74ddc7353 100644 --- a/api/jobfunction.go +++ b/api/jobfunction.go @@ -40,7 +40,7 @@ func (h JobFunctionHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.JobFunction // @router /jobfunctions/{id} [get] -// @param id path string true "Job Function ID" +// @param id path int true "Job Function ID" func (h JobFunctionHandler) Get(ctx *gin.Context) { m := &model.JobFunction{} id := h.pk(ctx) @@ -115,7 +115,7 @@ func (h JobFunctionHandler) Create(ctx *gin.Context) { // @tags jobfunctions // @success 204 // @router /jobfunctions/{id} [delete] -// @param id path string true "Job Function ID" +// @param id path int true "Job Function ID" func (h JobFunctionHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) m := &model.JobFunction{} @@ -140,7 +140,7 @@ func (h JobFunctionHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /jobfunctions/{id} [put] -// @param id path string true "Job Function ID" +// @param id path int true "Job Function ID" // @param job_function body api.JobFunction true "Job Function data" func (h JobFunctionHandler) Update(ctx *gin.Context) { id := h.pk(ctx) diff --git a/api/pkg.go b/api/pkg.go index beb78fb6e..f1a0a0cb8 100644 --- a/api/pkg.go +++ b/api/pkg.go @@ -1,5 +1,15 @@ package api +// @title Konveyor Hub API +// @version 0.3.z +// @description +// +// @license.name Apache 2.0 +// @license.url http://www.apache.org/licenses/LICENSE-2.0.html +// +// @accept application/json +// @produce application/json + import ( "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" diff --git a/api/proxy.go b/api/proxy.go index e7aecaf8f..a1dc58476 100644 --- a/api/proxy.go +++ b/api/proxy.go @@ -43,7 +43,7 @@ func (h ProxyHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} Proxy // @router /proxies/{id} [get] -// @param id path string true "Proxy ID" +// @param id path int true "Proxy ID" func (h ProxyHandler) Get(ctx *gin.Context) { id := h.pk(ctx) proxy := &model.Proxy{} @@ -122,7 +122,7 @@ func (h ProxyHandler) Create(ctx *gin.Context) { // @tags proxies // @success 204 // @router /proxies/{id} [delete] -// @param id path string true "Proxy ID" +// @param id path int true "Proxy ID" func (h ProxyHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) proxy := &model.Proxy{} @@ -147,7 +147,7 @@ func (h ProxyHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /proxies/{id} [put] -// @param id path string true "Proxy ID" +// @param id path int true "Proxy ID" // @param proxy body Proxy true "Proxy data" func (h ProxyHandler) Update(ctx *gin.Context) { id := h.pk(ctx) diff --git a/api/questionnaire.go b/api/questionnaire.go index cc7d3699e..79dae8cee 100644 --- a/api/questionnaire.go +++ b/api/questionnaire.go @@ -39,7 +39,7 @@ func (h QuestionnaireHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.Questionnaire // @router /questionnaires/{id} [get] -// @param id path string true "Questionnaire ID" +// @param id path int true "Questionnaire ID" func (h QuestionnaireHandler) Get(ctx *gin.Context) { m := &model.Questionnaire{} id := h.pk(ctx) @@ -114,7 +114,7 @@ func (h QuestionnaireHandler) Create(ctx *gin.Context) { // @tags questionnaires // @success 204 // @router /questionnaires/{id} [delete] -// @param id path string true "Questionnaire ID" +// @param id path int true "Questionnaire ID" func (h QuestionnaireHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) m := &model.Questionnaire{} @@ -145,7 +145,7 @@ func (h QuestionnaireHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /questionnaires/{id} [put] -// @param id path string true "Questionnaire ID" +// @param id path int true "Questionnaire ID" // @param questionnaire body api.Questionnaire true "Questionnaire data" func (h QuestionnaireHandler) Update(ctx *gin.Context) { id := h.pk(ctx) diff --git a/api/review.go b/api/review.go index 102cdbdb3..4e53c7ad7 100644 --- a/api/review.go +++ b/api/review.go @@ -42,7 +42,7 @@ func (h ReviewHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.Review // @router /reviews/{id} [get] -// @param id path string true "Review ID" +// @param id path int true "Review ID" func (h ReviewHandler) Get(ctx *gin.Context) { id := h.pk(ctx) m := &model.Review{} @@ -117,7 +117,7 @@ func (h ReviewHandler) Create(ctx *gin.Context) { // @tags reviews // @success 204 // @router /reviews/{id} [delete] -// @param id path string true "Review ID" +// @param id path int true "Review ID" func (h ReviewHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) m := &model.Review{} @@ -142,7 +142,7 @@ func (h ReviewHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /reviews/{id} [put] -// @param id path string true "Review ID" +// @param id path int true "Review ID" // @param review body api.Review true "Review data" func (h ReviewHandler) Update(ctx *gin.Context) { id := h.pk(ctx) diff --git a/api/ruleset.go b/api/ruleset.go index fd1d99915..094de8561 100644 --- a/api/ruleset.go +++ b/api/ruleset.go @@ -41,7 +41,7 @@ func (h RuleSetHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} RuleSet // @router /rulesets/{id} [get] -// @param id path string true "RuleSet ID" +// @param id path int true "RuleSet ID" func (h RuleSetHandler) Get(ctx *gin.Context) { id := h.pk(ctx) ruleset := &model.RuleSet{} @@ -132,7 +132,7 @@ func (h RuleSetHandler) Create(ctx *gin.Context) { // @tags rulesets // @success 204 // @router /rulesets/{id} [delete] -// @param id path string true "RuleSet ID" +// @param id path int true "RuleSet ID" func (h RuleSetHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) err := h.delete(ctx, id) @@ -151,7 +151,7 @@ func (h RuleSetHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /rulesets/{id} [put] -// @param id path string true "RuleSet ID" +// @param id path int true "RuleSet ID" // @param ruleBundle body RuleSet true "RuleSet data" func (h RuleSetHandler) Update(ctx *gin.Context) { id := h.pk(ctx) diff --git a/api/setting.go b/api/setting.go index 7d882d631..f21f5bb82 100644 --- a/api/setting.go +++ b/api/setting.go @@ -128,6 +128,7 @@ func (h SettingHandler) Create(ctx *gin.Context) { // @accept json // @success 201 // @router /settings/{key} [post] +// @param key path string true "Key" // @param setting body api.Setting true "Setting value" func (h SettingHandler) CreateByKey(ctx *gin.Context) { key := ctx.Param(Key) diff --git a/api/stakeholder.go b/api/stakeholder.go index f9f5afdcd..19fd328e6 100644 --- a/api/stakeholder.go +++ b/api/stakeholder.go @@ -40,7 +40,7 @@ func (h StakeholderHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.Stakeholder // @router /stakeholders/{id} [get] -// @param id path string true "Stakeholder ID" +// @param id path int true "Stakeholder ID" func (h StakeholderHandler) Get(ctx *gin.Context) { id := h.pk(ctx) m := &model.Stakeholder{} @@ -115,7 +115,7 @@ func (h StakeholderHandler) Create(ctx *gin.Context) { // @tags stakeholders // @success 204 // @router /stakeholders/{id} [delete] -// @param id path string true "Stakeholder ID" +// @param id path int true "Stakeholder ID" func (h StakeholderHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) m := &model.Stakeholder{} @@ -140,7 +140,7 @@ func (h StakeholderHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /stakeholders/{id} [put] -// @param id path string true "Stakeholder ID" +// @param id path int true "Stakeholder ID" // @param stakeholder body api.Stakeholder true "Stakeholder data" func (h StakeholderHandler) Update(ctx *gin.Context) { id := h.pk(ctx) diff --git a/api/tag.go b/api/tag.go index d2e385450..bd6fc9d1e 100644 --- a/api/tag.go +++ b/api/tag.go @@ -40,7 +40,7 @@ func (h TagHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.Tag // @router /tags/{id} [get] -// @param id path string true "Tag ID" +// @param id path int true "Tag ID" func (h TagHandler) Get(ctx *gin.Context) { id := h.pk(ctx) m := &model.Tag{} @@ -115,7 +115,7 @@ func (h TagHandler) Create(ctx *gin.Context) { // @tags tags // @success 204 // @router /tags/{id} [delete] -// @param id path string true "Tag ID" +// @param id path int true "Tag ID" func (h TagHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) m := &model.Tag{} @@ -140,7 +140,7 @@ func (h TagHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /tags/{id} [put] -// @param id path string true "Tag ID" +// @param id path int true "Tag ID" // @param tag body api.Tag true "Tag data" func (h TagHandler) Update(ctx *gin.Context) { id := h.pk(ctx) diff --git a/api/tagcategory.go b/api/tagcategory.go index 4c87cbf3d..92f5fd402 100644 --- a/api/tagcategory.go +++ b/api/tagcategory.go @@ -43,7 +43,7 @@ func (h TagCategoryHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.TagCategory // @router /tagcategories/{id} [get] -// @param id path string true "Tag Category ID" +// @param id path int true "Tag Category ID" func (h TagCategoryHandler) Get(ctx *gin.Context) { id := h.pk(ctx) m := &model.TagCategory{} @@ -122,7 +122,7 @@ func (h TagCategoryHandler) Create(ctx *gin.Context) { // @tags tagcategories // @success 204 // @router /tagcategories/{id} [delete] -// @param id path string true "Tag Category ID" +// @param id path int true "Tag Category ID" func (h TagCategoryHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) m := &model.TagCategory{} @@ -147,7 +147,7 @@ func (h TagCategoryHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /tagcategories/{id} [put] -// @param id path string true "Tag Category ID" +// @param id path int true "Tag Category ID" // @param tag_type body api.TagCategory true "Tag Category data" func (h TagCategoryHandler) Update(ctx *gin.Context) { id := h.pk(ctx) @@ -178,7 +178,7 @@ func (h TagCategoryHandler) Update(ctx *gin.Context) { // @produce json // @success 200 {object} []api.Tag // @router /tagcategories/{id}/tags [get] -// @param id path string true "Tag Category ID" +// @param id path int true "Tag Category ID" // @param name query string false "Optional tag name filter" func (h TagCategoryHandler) TagList(ctx *gin.Context) { id := h.pk(ctx) diff --git a/api/target.go b/api/target.go index 4c619ea4f..09e17c3ab 100644 --- a/api/target.go +++ b/api/target.go @@ -43,7 +43,7 @@ func (h TargetHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} Target // @router /targets/{id} [get] -// @param id path string true "Target ID" +// @param id path int true "Target ID" func (h TargetHandler) Get(ctx *gin.Context) { id := h.pk(ctx) target := &model.Target{} @@ -148,7 +148,7 @@ func (h TargetHandler) Create(ctx *gin.Context) { // @tags targets // @success 204 // @router /targets/{id} [delete] -// @param id path string true "Target ID" +// @param id path int true "Target ID" func (h TargetHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) target := &model.Target{} @@ -187,7 +187,7 @@ func (h TargetHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /targets/{id} [put] -// @param id path string true "Target ID" +// @param id path int true "Target ID" // @param target body Target true "Target data" func (h TargetHandler) Update(ctx *gin.Context) { id := h.pk(ctx) diff --git a/api/task.go b/api/task.go index e732f7426..1495b2f3a 100644 --- a/api/task.go +++ b/api/task.go @@ -71,7 +71,7 @@ func (h TaskHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.Task // @router /tasks/{id} [get] -// @param id path string true "Task ID" +// @param id path int true "Task ID" func (h TaskHandler) Get(ctx *gin.Context) { task := &model.Task{} id := h.pk(ctx) @@ -164,7 +164,7 @@ func (h TaskHandler) Create(ctx *gin.Context) { // @tags tasks // @success 204 // @router /tasks/{id} [delete] -// @param id path string true "Task ID" +// @param id path int true "Task ID" func (h TaskHandler) Delete(ctx *gin.Context) { id := h.pk(ctx) task := &model.Task{} @@ -197,7 +197,7 @@ func (h TaskHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /tasks/{id} [put] -// @param id path string true "Task ID" +// @param id path int true "Task ID" // @param task body Task true "Task data" func (h TaskHandler) Update(ctx *gin.Context) { id := h.pk(ctx) @@ -239,7 +239,7 @@ func (h TaskHandler) Update(ctx *gin.Context) { // @accept json // @success 204 // @router /tasks/{id}/submit [put] -// @param id path string true "Task ID" +// @param id path int true "Task ID" // @param task body Task false "Task data (optional)" func (h TaskHandler) Submit(ctx *gin.Context) { id := h.pk(ctx) @@ -270,7 +270,7 @@ func (h TaskHandler) Submit(ctx *gin.Context) { // @tags tasks // @success 204 // @router /tasks/{id}/cancel [put] -// @param id path string true "Task ID" +// @param id path int true "Task ID" func (h TaskHandler) Cancel(ctx *gin.Context) { id := h.pk(ctx) m := &model.Task{} @@ -317,7 +317,8 @@ func (h TaskHandler) Cancel(ctx *gin.Context) { // @produce octet-stream // @success 200 // @router /tasks/{id}/bucket/{wildcard} [get] -// @param id path string true "Task ID" +// @param id path int true "Task ID" +// @param wildcard path string true "Content path" // @param filter query string false "Filter" func (h TaskHandler) BucketGet(ctx *gin.Context) { m := &model.Task{} @@ -342,7 +343,8 @@ func (h TaskHandler) BucketGet(ctx *gin.Context) { // @produce json // @success 204 // @router /tasks/{id}/bucket/{wildcard} [post] -// @param id path string true "Task ID" +// @param id path int true "Task ID" +// @param wildcard path string true "Content path" func (h TaskHandler) BucketPut(ctx *gin.Context) { m := &model.Task{} id := h.pk(ctx) @@ -366,7 +368,8 @@ func (h TaskHandler) BucketPut(ctx *gin.Context) { // @produce json // @success 204 // @router /tasks/{id}/bucket/{wildcard} [delete] -// @param id path string true "Task ID" +// @param id path int true "Task ID" +// @param wildcard path string true "Content path" func (h TaskHandler) BucketDelete(ctx *gin.Context) { m := &model.Task{} id := h.pk(ctx) @@ -391,7 +394,7 @@ func (h TaskHandler) BucketDelete(ctx *gin.Context) { // @produce json // @success 201 {object} api.TaskReport // @router /tasks/{id}/report [post] -// @param id path string true "Task ID" +// @param id path int true "Task ID" // @param task body api.TaskReport true "TaskReport data" func (h TaskHandler) CreateReport(ctx *gin.Context) { id := h.pk(ctx) @@ -420,7 +423,7 @@ func (h TaskHandler) CreateReport(ctx *gin.Context) { // @produce json // @success 200 {object} api.TaskReport // @router /tasks/{id}/report [put] -// @param id path string true "Task ID" +// @param id path int true "Task ID" // @param task body api.TaskReport true "TaskReport data" func (h TaskHandler) UpdateReport(ctx *gin.Context) { id := h.pk(ctx) @@ -451,7 +454,7 @@ func (h TaskHandler) UpdateReport(ctx *gin.Context) { // @produce json // @success 204 // @router /tasks/{id}/report [delete] -// @param id path string true "Task ID" +// @param id path int true "Task ID" func (h TaskHandler) DeleteReport(ctx *gin.Context) { id := h.pk(ctx) m := &model.TaskReport{} diff --git a/api/taskgroup.go b/api/taskgroup.go index 74cbcad6b..a91aa5149 100644 --- a/api/taskgroup.go +++ b/api/taskgroup.go @@ -55,7 +55,7 @@ func (h TaskGroupHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.TaskGroup // @router /taskgroups/{id} [get] -// @param id path string true "TaskGroup ID" +// @param id path int true "TaskGroup ID" func (h TaskGroupHandler) Get(ctx *gin.Context) { m := &model.TaskGroup{} id := h.pk(ctx) @@ -152,7 +152,7 @@ func (h TaskGroupHandler) Create(ctx *gin.Context) { // @accept json // @success 204 // @router /taskgroups/{id} [put] -// @param id path string true "Task ID" +// @param id path int true "Task ID" // @param task body TaskGroup true "Task data" func (h TaskGroupHandler) Update(ctx *gin.Context) { id := h.pk(ctx) @@ -206,7 +206,7 @@ func (h TaskGroupHandler) Update(ctx *gin.Context) { // @tags taskgroups // @success 204 // @router /taskgroups/{id} [delete] -// @param id path string true "TaskGroup ID" +// @param id path int true "TaskGroup ID" func (h TaskGroupHandler) Delete(ctx *gin.Context) { m := &model.TaskGroup{} id := h.pk(ctx) @@ -251,7 +251,7 @@ func (h TaskGroupHandler) Delete(ctx *gin.Context) { // @accept json // @success 204 // @router /taskgroups/{id}/submit [put] -// @param id path string true "TaskGroup ID" +// @param id path int true "TaskGroup ID" // @param taskgroup body TaskGroup false "TaskGroup data (optional)" func (h TaskGroupHandler) Submit(ctx *gin.Context) { id := h.pk(ctx) @@ -285,7 +285,8 @@ func (h TaskGroupHandler) Submit(ctx *gin.Context) { // @produce octet-stream // @success 200 // @router /taskgroups/{id}/bucket/{wildcard} [get] -// @param id path string true "TaskGroup ID" +// @param id path int true "TaskGroup ID" +// @param wildcard path string true "Content path" // @param filter query string false "Filter" func (h TaskGroupHandler) BucketGet(ctx *gin.Context) { m := &model.TaskGroup{} @@ -310,7 +311,8 @@ func (h TaskGroupHandler) BucketGet(ctx *gin.Context) { // @produce json // @success 204 // @router /taskgroups/{id}/bucket/{wildcard} [post] -// @param id path string true "TaskGroup ID" +// @param id path int true "TaskGroup ID" +// @param wildcard path string true "Content path" func (h TaskGroupHandler) BucketPut(ctx *gin.Context) { m := &model.TaskGroup{} id := h.pk(ctx) @@ -334,7 +336,8 @@ func (h TaskGroupHandler) BucketPut(ctx *gin.Context) { // @produce json // @success 204 // @router /taskgroups/{id}/bucket/{wildcard} [delete] -// @param id path string true "Task ID" +// @param id path int true "Task ID" +// @param wildcard path string true "Content path" func (h TaskGroupHandler) BucketDelete(ctx *gin.Context) { m := &model.TaskGroup{} id := h.pk(ctx) diff --git a/api/ticket.go b/api/ticket.go index 0a9e4d0cc..69c4d27e6 100644 --- a/api/ticket.go +++ b/api/ticket.go @@ -43,7 +43,7 @@ func (h TicketHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.Ticket // @router /tickets/{id} [get] -// @param id path string true "Ticket ID" +// @param id path int true "Ticket ID" func (h TicketHandler) Get(ctx *gin.Context) { id := h.pk(ctx) m := &model.Ticket{} diff --git a/api/tracker.go b/api/tracker.go index 4f130de0a..46ee96d1b 100644 --- a/api/tracker.go +++ b/api/tracker.go @@ -51,7 +51,7 @@ func (h TrackerHandler) AddRoutes(e *gin.Engine) { // @produce json // @success 200 {object} api.Tracker // @router /trackers/{id} [get] -// @param id path string true "Tracker ID" +// @param id path int true "Tracker ID" func (h TrackerHandler) Get(ctx *gin.Context) { id := h.pk(ctx) m := &model.Tracker{} @@ -195,7 +195,7 @@ func (h TrackerHandler) Update(ctx *gin.Context) { // @produce json // @success 200 {object} []api.Project // @router /trackers/{id}/projects [get] -// @param id path string true "Tracker ID" +// @param id path int true "Tracker ID" func (h TrackerHandler) ProjectList(ctx *gin.Context) { id := h.pk(ctx) m := &model.Tracker{} @@ -236,7 +236,7 @@ func (h TrackerHandler) ProjectList(ctx *gin.Context) { // @produce json // @success 200 {object} api.Project // @router /trackers/{id}/projects/{id2} [get] -// @param id path string true "Tracker ID" +// @param id path int true "Tracker ID" // @param id2 path string true "Project ID" func (h TrackerHandler) ProjectGet(ctx *gin.Context) { id := h.pk(ctx) @@ -274,7 +274,7 @@ func (h TrackerHandler) ProjectGet(ctx *gin.Context) { // @produce json // @success 200 {object} []api.IssueType // @router /trackers/{id}/projects/{id2}/issuetypes [get] -// @param id path string true "Tracker ID" +// @param id path int true "Tracker ID" // @param id2 path string true "Project ID" func (h TrackerHandler) ProjectIssueTypeList(ctx *gin.Context) { id := h.pk(ctx) From 8d8caa25b830e1095f35d37c8c30e0ca0eaa4b85 Mon Sep 17 00:00:00 2001 From: Sam Lucidi Date: Thu, 26 Oct 2023 14:28:34 -0400 Subject: [PATCH 2/3] Fix swag target and add OpenAPI3 conversion target Signed-off-by: Sam Lucidi --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index b65f6ba8d..b957e2272 100644 --- a/Makefile +++ b/Makefile @@ -82,15 +82,19 @@ controller-gen: addon: fmt vet go build -o bin/addon github.com/konveyor/tackle2-hub/hack/cmd/addon -docs: docs-swagger docs-binding +docs: docs-html docs-openapi3 docs-binding # Build Swagger API spec into ./docs directory docs-swagger: - ${GOBIN}/swag init -g api/base.go + ${GOBIN}/swag init -g pkg.go --dir api,assessment + +# Build OpenAPI 3.0 docs +docs-openapi3: docs-swagger + curl -X POST -H "Content-Type: application/json" -d @docs/swagger.json https://converter.swagger.io/api/convert | jq > docs/openapi3.json # Build HTML docs from Swagger API spec -docs-html: docs-swagger - redoc-cli bundle -o docs/index.html docs/swagger.json +docs-html: docs-openapi3 + redoc-cli bundle -o docs/index.html docs/openapi3.json # Build binding doc. docs-binding: From 12b00a59a57f196015d60d037233f060afc8e9ab Mon Sep 17 00:00:00 2001 From: Sam Lucidi Date: Thu, 26 Oct 2023 14:29:22 -0400 Subject: [PATCH 3/3] Update documentation Signed-off-by: Sam Lucidi --- docs/docs.go | 427 ++- docs/index.html | 557 ++-- docs/openapi3.json | 7816 ++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.json | 427 ++- docs/swagger.yaml | 333 +- 5 files changed, 8979 insertions(+), 581 deletions(-) create mode 100644 docs/openapi3.json diff --git a/docs/docs.go b/docs/docs.go index 3ffbf7bef..63e0ce976 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -5,11 +5,21 @@ import "github.com/swaggo/swag" const docTemplate = `{ "schemes": {{ marshal .Schemes }}, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], "swagger": "2.0", "info": { "description": "{{escape .Description}}", "title": "{{.Title}}", "contact": {}, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, "version": "{{.Version}}" }, "host": "{{.Host}}", @@ -79,18 +89,26 @@ const docTemplate = `{ "summary": "Generate an application dependency graph arranged in topological order.", "parameters": [ { - "type": "array", - "description": "requested App IDs", + "description": "List of requested App IDs", "name": "requestedApps", - "in": "path", - "required": true + "in": "body", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "integer" + } + } } ], "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/api.DependencyGraph" + "type": "array", + "items": { + "$ref": "#/definitions/api.Vertex" + } } } } @@ -175,6 +193,15 @@ const docTemplate = `{ "issue" ], "summary": "Get an issue.", + "parameters": [ + { + "type": "integer", + "description": "Issue ID", + "name": "id", + "in": "path", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -195,6 +222,15 @@ const docTemplate = `{ "incidents" ], "summary": "List incidents for an issue.", + "parameters": [ + { + "type": "integer", + "description": "Issue ID", + "name": "id", + "in": "path", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -243,7 +279,7 @@ const docTemplate = `{ "summary": "List application issue reports.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -273,6 +309,15 @@ const docTemplate = `{ "filereports" ], "summary": "List incident file reports.", + "parameters": [ + { + "type": "integer", + "description": "Issue ID", + "name": "id", + "in": "path", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -321,7 +366,7 @@ const docTemplate = `{ "summary": "Get an analysis (report) by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Analysis ID", "name": "id", "in": "path", @@ -345,7 +390,7 @@ const docTemplate = `{ "summary": "Delete an analysis by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Analysis ID", "name": "id", "in": "path", @@ -369,6 +414,15 @@ const docTemplate = `{ "analyses" ], "summary": "Create an analysis.", + "parameters": [ + { + "type": "integer", + "description": "Application ID", + "name": "id", + "in": "path", + "required": true + } + ], "responses": { "201": { "description": "Created", @@ -391,7 +445,7 @@ const docTemplate = `{ "summary": "List application dependencies.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -423,7 +477,7 @@ const docTemplate = `{ "summary": "List application issues.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -619,7 +673,7 @@ const docTemplate = `{ "summary": "Get the latest analysis.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -648,7 +702,7 @@ const docTemplate = `{ "summary": "Get the latest analysis (static) report.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -703,6 +757,13 @@ const docTemplate = `{ ], "summary": "Create an application assessment.", "parameters": [ + { + "type": "integer", + "description": "Application ID", + "name": "id", + "in": "path", + "required": true + }, { "description": "Assessment data", "name": "assessment", @@ -735,12 +796,19 @@ const docTemplate = `{ "summary": "Get bucket content by ID and path.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", "required": true }, + { + "type": "string", + "description": "Content path", + "name": "wildcard", + "in": "path", + "required": true + }, { "type": "string", "description": "Filter", @@ -765,11 +833,18 @@ const docTemplate = `{ "summary": "Upload bucket content by ID and path.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", "required": true + }, + { + "type": "string", + "description": "Content path", + "name": "wildcard", + "in": "path", + "required": true } ], "responses": { @@ -789,11 +864,18 @@ const docTemplate = `{ "summary": "Delete bucket content by ID and path.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", "required": true + }, + { + "type": "string", + "description": "Content path", + "name": "wildcard", + "in": "path", + "required": true } ], "responses": { @@ -818,7 +900,7 @@ const docTemplate = `{ "summary": "Create a fact.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -853,7 +935,7 @@ const docTemplate = `{ "summary": "Get fact by name.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -890,7 +972,7 @@ const docTemplate = `{ "summary": "Update (or create) a fact.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -927,7 +1009,7 @@ const docTemplate = `{ "summary": "Delete a fact.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -960,7 +1042,7 @@ const docTemplate = `{ "summary": "List facts.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -991,7 +1073,7 @@ const docTemplate = `{ "summary": "Replace all facts from a source.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -1065,7 +1147,7 @@ const docTemplate = `{ "summary": "List tag references.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -1105,6 +1187,13 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/api.Ref" } + }, + { + "type": "integer", + "description": "Application ID", + "name": "id", + "in": "path", + "required": true } ], "responses": { @@ -1127,7 +1216,7 @@ const docTemplate = `{ "summary": "Replace tag associations.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -1168,7 +1257,7 @@ const docTemplate = `{ "summary": "Delete tag association.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Application ID", "name": "id", "in": "path", @@ -1256,7 +1345,7 @@ const docTemplate = `{ "summary": "Get an archetype by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Archetype ID", "name": "id", "in": "path", @@ -1283,7 +1372,7 @@ const docTemplate = `{ "summary": "Update an archetype.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Archetype ID", "name": "id", "in": "path", @@ -1313,7 +1402,7 @@ const docTemplate = `{ "summary": "Delete an archetype.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Archetype ID", "name": "id", "in": "path", @@ -1376,6 +1465,13 @@ const docTemplate = `{ "schema": { "$ref": "#/definitions/api.Assessment" } + }, + { + "type": "integer", + "description": "Archetype ID", + "name": "id", + "in": "path", + "required": true } ], "responses": { @@ -1423,7 +1519,7 @@ const docTemplate = `{ "summary": "Get an assessment by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Assessment ID", "name": "id", "in": "path", @@ -1450,7 +1546,7 @@ const docTemplate = `{ "summary": "Update an assessment.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Assessment ID", "name": "id", "in": "path", @@ -1480,7 +1576,7 @@ const docTemplate = `{ "summary": "Delete an assessment.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Assessment ID", "name": "id", "in": "path", @@ -1675,7 +1771,7 @@ const docTemplate = `{ "summary": "Get a bucket by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Bucket ID", "name": "id", "in": "path", @@ -1699,7 +1795,7 @@ const docTemplate = `{ "summary": "Delete a bucket.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Bucket ID", "name": "id", "in": "path", @@ -1725,12 +1821,19 @@ const docTemplate = `{ "summary": "Get bucket content by ID and path.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", "required": true }, + { + "type": "string", + "description": "Content path", + "name": "wildcard", + "in": "path", + "required": true + }, { "type": "string", "description": "Filter", @@ -1755,11 +1858,18 @@ const docTemplate = `{ "summary": "Upload bucket content by ID and path.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Bucket ID", "name": "id", "in": "path", "required": true + }, + { + "type": "string", + "description": "Content path", + "name": "wildcard", + "in": "path", + "required": true } ], "responses": { @@ -1779,11 +1889,18 @@ const docTemplate = `{ "summary": "Delete bucket content by ID and path.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Bucket ID", "name": "id", "in": "path", "required": true + }, + { + "type": "string", + "description": "Content path", + "name": "wildcard", + "in": "path", + "required": true } ], "responses": { @@ -1857,7 +1974,7 @@ const docTemplate = `{ "summary": "Get a business service by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Business Service ID", "name": "id", "in": "path", @@ -1884,7 +2001,7 @@ const docTemplate = `{ "summary": "Update a business service.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Business service ID", "name": "id", "in": "path", @@ -1914,7 +2031,7 @@ const docTemplate = `{ "summary": "Delete a business service.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Business service ID", "name": "id", "in": "path", @@ -1945,7 +2062,7 @@ const docTemplate = `{ } } }, - "/caches/{id}": { + "/caches/{wildcard}": { "get": { "description": "Get the cache.", "produces": [ @@ -1959,7 +2076,7 @@ const docTemplate = `{ { "type": "string", "description": "Cache DIR", - "name": "name", + "name": "wildcard", "in": "path", "required": true } @@ -2041,7 +2158,7 @@ const docTemplate = `{ "summary": "Get a dependency by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Dependency ID", "name": "id", "in": "path", @@ -2068,7 +2185,7 @@ const docTemplate = `{ "summary": "Delete a dependency.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Dependency id", "name": "id", "in": "path", @@ -2147,7 +2264,7 @@ const docTemplate = `{ "summary": "Get a file by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "File ID", "name": "id", "in": "path", @@ -2171,7 +2288,7 @@ const docTemplate = `{ "summary": "Delete a file.", "parameters": [ { - "type": "string", + "type": "integer", "description": "File ID", "name": "id", "in": "path", @@ -2252,7 +2369,7 @@ const docTemplate = `{ "summary": "Get an identity by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Identity ID", "name": "id", "in": "path", @@ -2279,7 +2396,7 @@ const docTemplate = `{ "summary": "Update an identity.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Identity ID", "name": "id", "in": "path", @@ -2309,7 +2426,7 @@ const docTemplate = `{ "summary": "Delete an identity.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Identity ID", "name": "id", "in": "path", @@ -2358,7 +2475,7 @@ const docTemplate = `{ "summary": "Get an import by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Import ID", "name": "id", "in": "path", @@ -2382,7 +2499,7 @@ const docTemplate = `{ "summary": "Delete an import.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Import ID", "name": "id", "in": "path", @@ -2480,7 +2597,7 @@ const docTemplate = `{ "summary": "Get an import summary by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "ImportSummary ID", "name": "id", "in": "path", @@ -2504,7 +2621,7 @@ const docTemplate = `{ "summary": "Delete an import summary and associated import records.", "parameters": [ { - "type": "string", + "type": "integer", "description": "ImportSummary ID", "name": "id", "in": "path", @@ -2585,7 +2702,7 @@ const docTemplate = `{ "summary": "Get a job function by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Job Function ID", "name": "id", "in": "path", @@ -2612,7 +2729,7 @@ const docTemplate = `{ "summary": "Update a job function.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Job Function ID", "name": "id", "in": "path", @@ -2642,7 +2759,7 @@ const docTemplate = `{ "summary": "Delete a job function.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Job Function ID", "name": "id", "in": "path", @@ -2878,7 +2995,7 @@ const docTemplate = `{ "summary": "Get an proxy by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Proxy ID", "name": "id", "in": "path", @@ -2905,7 +3022,7 @@ const docTemplate = `{ "summary": "Update an proxy.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Proxy ID", "name": "id", "in": "path", @@ -2935,7 +3052,7 @@ const docTemplate = `{ "summary": "Delete an proxy.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Proxy ID", "name": "id", "in": "path", @@ -3016,7 +3133,7 @@ const docTemplate = `{ "summary": "Get a questionnaire by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Questionnaire ID", "name": "id", "in": "path", @@ -3043,7 +3160,7 @@ const docTemplate = `{ "summary": "Update a questionnaire.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Questionnaire ID", "name": "id", "in": "path", @@ -3073,7 +3190,7 @@ const docTemplate = `{ "summary": "Delete a questionnaire.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Questionnaire ID", "name": "id", "in": "path", @@ -3182,7 +3299,7 @@ const docTemplate = `{ "summary": "Get a review by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Review ID", "name": "id", "in": "path", @@ -3209,7 +3326,7 @@ const docTemplate = `{ "summary": "Update a review.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Review ID", "name": "id", "in": "path", @@ -3239,7 +3356,7 @@ const docTemplate = `{ "summary": "Delete a review.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Review ID", "name": "id", "in": "path", @@ -3320,7 +3437,7 @@ const docTemplate = `{ "summary": "Get a RuleSet by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "RuleSet ID", "name": "id", "in": "path", @@ -3347,7 +3464,7 @@ const docTemplate = `{ "summary": "Update a ruleset.", "parameters": [ { - "type": "string", + "type": "integer", "description": "RuleSet ID", "name": "id", "in": "path", @@ -3377,7 +3494,7 @@ const docTemplate = `{ "summary": "Delete a ruleset.", "parameters": [ { - "type": "string", + "type": "integer", "description": "RuleSet ID", "name": "id", "in": "path", @@ -3531,6 +3648,13 @@ const docTemplate = `{ ], "summary": "Create a setting.", "parameters": [ + { + "type": "string", + "description": "Key", + "name": "key", + "in": "path", + "required": true + }, { "description": "Setting value", "name": "setting", @@ -3636,7 +3760,7 @@ const docTemplate = `{ "summary": "Get a stakeholder group by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Stakeholder Group ID", "name": "id", "in": "path", @@ -3663,7 +3787,7 @@ const docTemplate = `{ "summary": "Update a stakeholder group.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Stakeholder Group ID", "name": "id", "in": "path", @@ -3693,7 +3817,7 @@ const docTemplate = `{ "summary": "Delete a stakeholder group.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Stakeholder Group ID", "name": "id", "in": "path", @@ -3774,7 +3898,7 @@ const docTemplate = `{ "summary": "Get a stakeholder by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Stakeholder ID", "name": "id", "in": "path", @@ -3801,7 +3925,7 @@ const docTemplate = `{ "summary": "Update a stakeholder.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Stakeholder ID", "name": "id", "in": "path", @@ -3831,7 +3955,7 @@ const docTemplate = `{ "summary": "Delete a stakeholder.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Stakeholder ID", "name": "id", "in": "path", @@ -3920,7 +4044,7 @@ const docTemplate = `{ "summary": "Get a tag category by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Tag Category ID", "name": "id", "in": "path", @@ -3947,7 +4071,7 @@ const docTemplate = `{ "summary": "Update a tag category.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Tag Category ID", "name": "id", "in": "path", @@ -3977,7 +4101,7 @@ const docTemplate = `{ "summary": "Delete a tag category.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Tag Category ID", "name": "id", "in": "path", @@ -4003,7 +4127,7 @@ const docTemplate = `{ "summary": "List the tags in the tag category.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Tag Category ID", "name": "id", "in": "path", @@ -4096,7 +4220,7 @@ const docTemplate = `{ "summary": "Get a tag by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Tag ID", "name": "id", "in": "path", @@ -4123,7 +4247,7 @@ const docTemplate = `{ "summary": "Update a tag.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Tag ID", "name": "id", "in": "path", @@ -4153,7 +4277,7 @@ const docTemplate = `{ "summary": "Delete a tag.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Tag ID", "name": "id", "in": "path", @@ -4234,7 +4358,7 @@ const docTemplate = `{ "summary": "Get a Target by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Target ID", "name": "id", "in": "path", @@ -4261,7 +4385,7 @@ const docTemplate = `{ "summary": "Update a target.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Target ID", "name": "id", "in": "path", @@ -4291,7 +4415,7 @@ const docTemplate = `{ "summary": "Delete a target.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Target ID", "name": "id", "in": "path", @@ -4372,7 +4496,7 @@ const docTemplate = `{ "summary": "Get a task group by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "TaskGroup ID", "name": "id", "in": "path", @@ -4399,7 +4523,7 @@ const docTemplate = `{ "summary": "Update a task group.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", @@ -4429,7 +4553,7 @@ const docTemplate = `{ "summary": "Delete a task group.", "parameters": [ { - "type": "string", + "type": "integer", "description": "TaskGroup ID", "name": "id", "in": "path", @@ -4455,12 +4579,19 @@ const docTemplate = `{ "summary": "Get bucket content by ID and path.", "parameters": [ { - "type": "string", + "type": "integer", "description": "TaskGroup ID", "name": "id", "in": "path", "required": true }, + { + "type": "string", + "description": "Content path", + "name": "wildcard", + "in": "path", + "required": true + }, { "type": "string", "description": "Filter", @@ -4485,11 +4616,18 @@ const docTemplate = `{ "summary": "Upload bucket content by ID and path.", "parameters": [ { - "type": "string", + "type": "integer", "description": "TaskGroup ID", "name": "id", "in": "path", "required": true + }, + { + "type": "string", + "description": "Content path", + "name": "wildcard", + "in": "path", + "required": true } ], "responses": { @@ -4509,11 +4647,18 @@ const docTemplate = `{ "summary": "Delete bucket content by ID and path.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", "required": true + }, + { + "type": "string", + "description": "Content path", + "name": "wildcard", + "in": "path", + "required": true } ], "responses": { @@ -4535,7 +4680,7 @@ const docTemplate = `{ "summary": "Submit a task group.", "parameters": [ { - "type": "string", + "type": "integer", "description": "TaskGroup ID", "name": "id", "in": "path", @@ -4624,7 +4769,7 @@ const docTemplate = `{ "summary": "Get a task by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", @@ -4651,7 +4796,7 @@ const docTemplate = `{ "summary": "Update a task.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", @@ -4681,7 +4826,7 @@ const docTemplate = `{ "summary": "Delete a task.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", @@ -4707,12 +4852,19 @@ const docTemplate = `{ "summary": "Get bucket content by ID and path.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", "required": true }, + { + "type": "string", + "description": "Content path", + "name": "wildcard", + "in": "path", + "required": true + }, { "type": "string", "description": "Filter", @@ -4737,11 +4889,18 @@ const docTemplate = `{ "summary": "Upload bucket content by ID and path.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", "required": true + }, + { + "type": "string", + "description": "Content path", + "name": "wildcard", + "in": "path", + "required": true } ], "responses": { @@ -4761,11 +4920,18 @@ const docTemplate = `{ "summary": "Delete bucket content by ID and path.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", "required": true + }, + { + "type": "string", + "description": "Content path", + "name": "wildcard", + "in": "path", + "required": true } ], "responses": { @@ -4784,7 +4950,7 @@ const docTemplate = `{ "summary": "Cancel a task.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", @@ -4813,7 +4979,7 @@ const docTemplate = `{ "summary": "Update a task report.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", @@ -4852,7 +5018,7 @@ const docTemplate = `{ "summary": "Create a task report.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", @@ -4891,7 +5057,7 @@ const docTemplate = `{ "summary": "Delete a task report.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", @@ -4917,7 +5083,7 @@ const docTemplate = `{ "summary": "Submit a task.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Task ID", "name": "id", "in": "path", @@ -5006,7 +5172,7 @@ const docTemplate = `{ "summary": "Get a ticket by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Ticket ID", "name": "id", "in": "path", @@ -5111,7 +5277,7 @@ const docTemplate = `{ "summary": "Get a tracker by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Tracker ID", "name": "id", "in": "path", @@ -5194,7 +5360,7 @@ const docTemplate = `{ "summary": "List a tracker's projects.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Tracker ID", "name": "id", "in": "path", @@ -5226,7 +5392,7 @@ const docTemplate = `{ "summary": "Get a tracker project by ID.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Tracker ID", "name": "id", "in": "path", @@ -5262,7 +5428,7 @@ const docTemplate = `{ "summary": "List a tracker project's issue types.", "parameters": [ { - "type": "string", + "type": "integer", "description": "Tracker ID", "name": "id", "in": "path", @@ -5373,6 +5539,9 @@ const docTemplate = `{ "comments": { "type": "string" }, + "confidence": { + "type": "integer" + }, "contributors": { "type": "array", "items": { @@ -5388,6 +5557,9 @@ const docTemplate = `{ "description": { "type": "string" }, + "effort": { + "type": "integer" + }, "id": { "type": "integer" }, @@ -5412,6 +5584,9 @@ const docTemplate = `{ "review": { "$ref": "#/definitions/api.Ref" }, + "risk": { + "type": "string" + }, "tags": { "type": "array", "items": { @@ -5444,6 +5619,9 @@ const docTemplate = `{ "comments": { "type": "string" }, + "confidence": { + "type": "integer" + }, "createTime": { "type": "string" }, @@ -5468,6 +5646,9 @@ const docTemplate = `{ "review": { "$ref": "#/definitions/api.Ref" }, + "risk": { + "type": "string" + }, "stakeholderGroups": { "type": "array", "items": { @@ -5710,9 +5891,6 @@ const docTemplate = `{ } } }, - "api.DependencyGraph": { - "type": "object" - }, "api.Fact": { "type": "object", "properties": { @@ -6726,6 +6904,9 @@ const docTemplate = `{ "name": { "type": "string" }, + "provider": { + "type": "string" + }, "ruleset": { "$ref": "#/definitions/api.RuleSet" }, @@ -7065,6 +7246,32 @@ const docTemplate = `{ } } }, + "api.Vertex": { + "type": "object", + "properties": { + "applicationId": { + "type": "integer" + }, + "applicationName": { + "type": "string" + }, + "decision": { + "type": "string" + }, + "effort": { + "type": "integer" + }, + "effortEstimate": { + "type": "string" + }, + "positionX": { + "type": "integer" + }, + "positionY": { + "type": "integer" + } + } + }, "assessment.Answer": { "type": "object", "required": [ @@ -7214,11 +7421,11 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ - Version: "", + Version: "0.3.z", Host: "", BasePath: "", Schemes: []string{}, - Title: "", + Title: "Konveyor Hub API", Description: "", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, diff --git a/docs/index.html b/docs/index.html index bea91c0c5..d63749231 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3,7 +3,7 @@ - ReDoc documentation + Konveyor Hub API