Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 68e0e1f

Browse files
committed
types.metadata: Add JSON annotations
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
1 parent 019f459 commit 68e0e1f

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

types/metadata/metadata.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66

77
// Maintainer represents one of the apps's maintainers
88
type Maintainer struct {
9-
Name string
10-
Email string
9+
Name string `json:"name"`
10+
Email string `json:"email,omitempty"`
1111
}
1212

1313
// Maintainers is a list of maintainers
@@ -33,23 +33,23 @@ func (m Maintainer) String() string {
3333

3434
// AppMetadata is the format of the data found inside the metadata.yml file
3535
type AppMetadata struct {
36-
Version string
37-
Name string
38-
Description string
39-
Namespace string
40-
Maintainers Maintainers
41-
Parents Parents
36+
Version string `json:"version"`
37+
Name string `json:"name"`
38+
Description string `json:"description,omitempty"`
39+
Namespace string `json:"namespace,omitempty"`
40+
Maintainers Maintainers `json:"maintainers,omitempty"`
41+
Parents Parents `yaml:",omitempty" json:"parents,omitempty"`
4242
}
4343

4444
// Parents is a list of ParentMetadata items
4545
type Parents []ParentMetadata
4646

4747
// ParentMetadata contains historical data of forked packages
4848
type ParentMetadata struct {
49-
Name string
50-
Namespace string
51-
Version string
52-
Maintainers Maintainers
49+
Name string `json:"name"`
50+
Namespace string `json:"namespace,omitempty"`
51+
Version string `json:"version"`
52+
Maintainers Maintainers `json:"maintainers,omitempty"`
5353
}
5454

5555
// Modifier is a function signature that takes and returns an AppMetadata object

0 commit comments

Comments
 (0)