Skip to content

Commit

Permalink
Adds v1 support to APIs
Browse files Browse the repository at this point in the history
This adds /v1 support to existing APIs. This adds additional route
with existing for all user facing APIs. Preview route will be
deprecated in next release after first non-preview.

Signed-off-by: Shivam Mukhade <[email protected]>
  • Loading branch information
SM43 authored and tekton-robot committed Jan 13, 2021
1 parent 7409b16 commit f645eea
Show file tree
Hide file tree
Showing 24 changed files with 2,052 additions and 334 deletions.
2 changes: 1 addition & 1 deletion api/design/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
var _ = API("hub", func() {
Title("Tekton Hub")
Description("HTTP services for managing Tekton Hub")
Version("0.1")
Version("1.0")
Meta("swagger:example", "false")
Server("hub", func() {
Host("production", func() {
Expand Down
7 changes: 2 additions & 5 deletions api/design/category.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ import (
var _ = Service("category", func() {
Description("The category service provides details about category")

HTTP(func() {
Path("/categories")
})

Error("internal-error", ErrorResult, "Internal Server Error")

Method("list", func() {
Expand All @@ -34,7 +30,8 @@ var _ = Service("category", func() {
})

HTTP(func() {
GET("/")
GET("/categories")
GET("/v1/categories")

Response(StatusOK)
Response("internal-error", StatusInternalServerError)
Expand Down
9 changes: 9 additions & 0 deletions api/design/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ var _ = Service("resource", func() {

HTTP(func() {
GET("/query")
GET("/v1/query")

Param("name")
Param("kinds")
Param("tags")
Expand All @@ -79,6 +81,8 @@ var _ = Service("resource", func() {

HTTP(func() {
GET("/resources")
GET("/v1/resources")

Param("limit")

Response(StatusOK)
Expand All @@ -98,6 +102,7 @@ var _ = Service("resource", func() {

HTTP(func() {
GET("/resource/{id}/versions")
GET("/v1/resource/{id}/versions")

Response(StatusOK)
Response("internal-error", StatusInternalServerError)
Expand Down Expand Up @@ -127,6 +132,7 @@ var _ = Service("resource", func() {

HTTP(func() {
GET("/resource/{catalog}/{kind}/{name}/{version}")
GET("/v1/resource/{catalog}/{kind}/{name}/{version}")

Response(StatusOK)
Response("internal-error", StatusInternalServerError)
Expand All @@ -146,6 +152,7 @@ var _ = Service("resource", func() {

HTTP(func() {
GET("/resource/version/{versionID}")
GET("/v1/resource/version/{versionID}")

Response(StatusOK)
Response("internal-error", StatusInternalServerError)
Expand All @@ -171,6 +178,7 @@ var _ = Service("resource", func() {

HTTP(func() {
GET("/resource/{catalog}/{kind}/{name}")
GET("/v1/resource/{catalog}/{kind}/{name}")

Response(StatusOK)
Response("internal-error", StatusInternalServerError)
Expand All @@ -190,6 +198,7 @@ var _ = Service("resource", func() {

HTTP(func() {
GET("/resource/{id}")
GET("/v1/resource/{id}")

Response(StatusOK)
Response("internal-error", StatusInternalServerError)
Expand Down
5 changes: 5 additions & 0 deletions api/gen/http/category/client/paths.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions api/gen/http/category/server/paths.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions api/gen/http/category/server/server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/gen/http/cli/hub/cli.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/gen/http/openapi.json

Large diffs are not rendered by default.

Loading

0 comments on commit f645eea

Please sign in to comment.