diff --git a/pkg/cmd/release/shared/fetch.go b/pkg/cmd/release/shared/fetch.go index 84a9a369b..c9cf7a6a4 100644 --- a/pkg/cmd/release/shared/fetch.go +++ b/pkg/cmd/release/shared/fetch.go @@ -21,22 +21,23 @@ import ( ) var ReleaseFields = []string{ - "url", "apiUrl", - "uploadUrl", - "tarballUrl", - "zipballUrl", - "id", - "tagName", - "name", - "body", - "isDraft", - "isPrerelease", - "createdAt", - "publishedAt", - "targetCommitish", "author", "assets", + "body", + "createdAt", + "databaseId", + "id", + "isDraft", + "isPrerelease", + "name", + "publishedAt", + "tagName", + "tarballUrl", + "targetCommitish", + "uploadUrl", + "url", + "zipballUrl", } type Release struct { diff --git a/pkg/cmd/release/view/view_test.go b/pkg/cmd/release/view/view_test.go index c8b837923..629c0728d 100644 --- a/pkg/cmd/release/view/view_test.go +++ b/pkg/cmd/release/view/view_test.go @@ -14,11 +14,34 @@ import ( "github.com/cli/cli/v2/pkg/cmdutil" "github.com/cli/cli/v2/pkg/httpmock" "github.com/cli/cli/v2/pkg/iostreams" + "github.com/cli/cli/v2/pkg/jsonfieldstest" "github.com/google/shlex" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) +func TestJSONFields(t *testing.T) { + jsonfieldstest.ExpectCommandToSupportJSONFields(t, NewCmdView, []string{ + "apiUrl", + "author", + "assets", + "body", + "createdAt", + "databaseId", + "id", + "isDraft", + "isPrerelease", + "name", + "publishedAt", + "tagName", + "tarballUrl", + "targetCommitish", + "uploadUrl", + "url", + "zipballUrl", + }) +} + func Test_NewCmdView(t *testing.T) { tests := []struct { name string