Skip to content

Commit 3861d54

Browse files
slug of the download-starter-project endpoint changed (#119)
* download starter project endpoint slug changed. * download starter project endpoint integration testing changed to reflect slug change. * registry REST API doc changed to reflect download starter project endpoint slug change. Signed-off-by: Michael Valdron <[email protected]>
1 parent 8328a8a commit 3861d54

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

index/server/pkg/server/index.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ func ServeRegistry() {
136136
router.GET("/health", serveHealthCheck)
137137
router.GET("/devfiles/:name", serveDevfile)
138138
router.GET("/devfiles/:name/:version", serveDevfileWithVersion)
139-
router.GET("/devfiles/:name/starterProjects/:starterProjectName", serveDevfileStarterProject)
140-
router.GET("/devfiles/:name/:version/starterProjects/:starterProjectName", serveDevfileStarterProjectWithVersion)
139+
router.GET("/devfiles/:name/starter-projects/:starterProjectName", serveDevfileStarterProject)
140+
router.GET("/devfiles/:name/:version/starter-projects/:starterProjectName", serveDevfileStarterProjectWithVersion)
141141

142142
// Registry REST APIs for index v2
143143
router.GET("/v2index", serveDevfileIndexV2)

index/server/registry-REST-API.adoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -2032,7 +2032,7 @@ Note: Only provides download as the response, not the devfile content.
20322032
=== HTTP Request
20332033
[source]
20342034
----
2035-
GET http://{registry host}/devfiles/{stack}/starterProjects/{starterProject}
2035+
GET http://{registry host}/devfiles/{stack}/starter-projects/{starterProject}
20362036
----
20372037

20382038
=== Request Parameters
@@ -2058,7 +2058,7 @@ The request body must be empty.
20582058
=== Request example
20592059
[source]
20602060
----
2061-
curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs/starterProjects/nodejs-starter -o nodejs-starter.zip
2061+
curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs/starter-projects/nodejs-starter -o nodejs-starter.zip
20622062
----
20632063

20642064
=== Response example
@@ -2078,7 +2078,7 @@ Note: Only provides download as the response, not the devfile content.
20782078
=== HTTP Request
20792079
[source]
20802080
----
2081-
GET http://{registry host}/devfiles/{stack}/{version}/starterProjects/{starterProject}
2081+
GET http://{registry host}/devfiles/{stack}/{version}/starter-projects/{starterProject}
20822082
----
20832083

20842084
=== Request Parameters
@@ -2107,7 +2107,7 @@ The request body must be empty.
21072107
=== Request example
21082108
[source]
21092109
----
2110-
curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs/1.0.1/starterProjects/nodejs-starter -o nodejs-starter.zip
2110+
curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs/1.0.1/starter-projects/nodejs-starter -o nodejs-starter.zip
21112111
----
21122112

21132113
=== Response example

tests/integration/pkg/tests/indexserver_tests.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
284284
}
285285
})
286286

287-
ginkgo.It("/devfiles/<devfile>/starterProjects/<starterProject> endpoint should return a zip archive for devfile starter project", func() {
288-
resp, err := http.Get(config.Registry + "/devfiles/java-maven/starterProjects/springbootproject")
287+
ginkgo.It("/devfiles/<devfile>/starter-projects/<starterProject> endpoint should return a zip archive for devfile starter project", func() {
288+
resp, err := http.Get(config.Registry + "/devfiles/java-maven/starter-projects/springbootproject")
289289
var bytes []byte
290290

291291
gomega.Expect(err).NotTo(gomega.HaveOccurred())
@@ -301,8 +301,8 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
301301
}))
302302
})
303303

304-
ginkgo.It("/devfiles/<devfile>/<version>/starterProjects/<starterProject> endpoint should return a zip archive for devfile starter project", func() {
305-
resp, err := http.Get(config.Registry + "/devfiles/java-maven/latest/starterProjects/springbootproject")
304+
ginkgo.It("/devfiles/<devfile>/<version>/starter-projects/<starterProject> endpoint should return a zip archive for devfile starter project", func() {
305+
resp, err := http.Get(config.Registry + "/devfiles/java-maven/latest/starter-projects/springbootproject")
306306
var bytes []byte
307307

308308
gomega.Expect(err).NotTo(gomega.HaveOccurred())
@@ -318,15 +318,15 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
318318
}))
319319
})
320320

321-
ginkgo.It("/devfiles/<devfile>/starterProjects/<starterProject> endpoint should return an error for a devfile that doesn't exist", func() {
322-
resp, err := http.Get(config.Registry + "/devfiles/fake-stack/starterProjects/springbootproject")
321+
ginkgo.It("/devfiles/<devfile>/starter-projects/<starterProject> endpoint should return an error for a devfile that doesn't exist", func() {
322+
resp, err := http.Get(config.Registry + "/devfiles/fake-stack/starter-projects/springbootproject")
323323

324324
gomega.Expect(err).NotTo(gomega.HaveOccurred())
325325
gomega.Expect(resp.StatusCode).To(gomega.Equal(http.StatusNotFound))
326326
})
327327

328-
ginkgo.It("/devfiles/<devfile>/starterProjects/<starterProject> endpoint should return an error for a starter project that doesn't exist", func() {
329-
resp, err := http.Get(config.Registry + "/devfiles/java-maven/starterProjects/fake-project")
328+
ginkgo.It("/devfiles/<devfile>/starter-projects/<starterProject> endpoint should return an error for a starter project that doesn't exist", func() {
329+
resp, err := http.Get(config.Registry + "/devfiles/java-maven/starter-projects/fake-project")
330330

331331
gomega.Expect(err).NotTo(gomega.HaveOccurred())
332332
gomega.Expect(resp.StatusCode).To(gomega.Equal(http.StatusNotFound))

0 commit comments

Comments
 (0)