Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Updates /categories api to list categories only and removes tags #264

Merged
merged 2 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions api/design/types/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,8 @@ var Category = Type("Category", func() {
Attribute("name", String, "Name of category", func() {
Example("name", "Image Builder")
})
Attribute("tags", Tags, "List of tags associated with the category", func() {
Example("tags", func() {
Value([]Val{
{"id": 1, "name": "image-build"},
{"id": 2, "name": "kaniko"},
})
})
})

Required("id", "name", "tags")
Required("id", "name")
})

var Catalog = ResultType("application/vnd.hub.catalog", "Catalog", func() {
Expand Down
9 changes: 0 additions & 9 deletions api/gen/category/service.go

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

15 changes: 0 additions & 15 deletions api/gen/http/category/client/encode_decode.go

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

31 changes: 0 additions & 31 deletions api/gen/http/category/client/types.go

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

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

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

10 changes: 0 additions & 10 deletions api/gen/http/category/server/types.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.

46 changes: 0 additions & 46 deletions api/gen/http/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1770,48 +1770,18 @@ definitions:
example:
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
example:
data:
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
CategoryResponseBody:
title: CategoryResponseBody
type: object
Expand All @@ -1825,28 +1795,12 @@ definitions:
type: string
description: Name of category
example: Image Builder
tags:
type: array
items:
$ref: '#/definitions/TagResponseBody'
description: List of tags associated with the category
example:
- id: 1
name: image-build
- id: 2
name: kaniko
example:
id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
required:
- id
- name
- tags
HubServiceResponseBody:
title: HubServiceResponseBody
type: object
Expand Down
2 changes: 1 addition & 1 deletion api/gen/http/openapi3.json

Large diffs are not rendered by default.

95 changes: 1 addition & 94 deletions api/gen/http/openapi3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,25 +291,10 @@ paths:
data:
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
"500":
description: Internal Server Error response.
content:
Expand Down Expand Up @@ -1491,25 +1476,10 @@ paths:
data:
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
"500":
description: Internal Server Error response.
content:
Expand Down Expand Up @@ -1680,28 +1650,12 @@ components:
type: string
description: Name of category
example: Image Builder
tags:
type: array
items:
$ref: '#/components/schemas/Tag'
description: List of tags associated with the category
example:
- id: 1
name: image-build
- id: 2
name: kaniko
example:
id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
required:
- id
- name
- tags
Error:
type: object
properties:
Expand Down Expand Up @@ -1826,48 +1780,18 @@ components:
example:
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
example:
data:
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
- id: 1
name: Image Builder
tags:
- id: 1
name: image-build
- id: 2
name: kaniko
NewRefreshTokenResponseBody:
type: object
properties:
Expand Down Expand Up @@ -1978,7 +1902,7 @@ components:
tags:
type: array
items:
$ref: '#/components/schemas/Tag'
$ref: '#/components/schemas/Category'
description: Tags related to resource
example:
- id: 1
Expand Down Expand Up @@ -2297,23 +2221,6 @@ components:
- error: unable to reach db
name: api
status: ok
Tag:
type: object
properties:
id:
type: integer
description: ID is the unique id of tag
example: 1
name:
type: string
description: Name of tag
example: image-build
example:
id: 1
name: image-build
required:
- id
- name
Token:
type: object
properties:
Expand Down
1 change: 0 additions & 1 deletion api/pkg/app/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type Data struct {

type Category struct {
Name string
Tags []string
}

type Catalog struct {
Expand Down
Loading