Skip to content

Commit 15d4b3e

Browse files
committed
remove remaining jsonapi tags
1 parent 8008df6 commit 15d4b3e

File tree

4 files changed

+33
-37
lines changed

4 files changed

+33
-37
lines changed

jsonapi/fixtures_test.go

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
type Magic struct {
14-
ID MagicID `jsonapi:"-" json:"-"`
14+
ID MagicID `json:"-"`
1515
}
1616

1717
func (m Magic) GetID() string {
@@ -25,7 +25,7 @@ func (m MagicID) String() string {
2525
}
2626

2727
type Comment struct {
28-
ID int `jsonapi:"-" json:"-"`
28+
ID int `json:"-"`
2929
Text string `json:"text"`
3030
}
3131

@@ -45,9 +45,9 @@ func (c *Comment) SetID(stringID string) error {
4545
}
4646

4747
type User struct {
48-
ID int `jsonapi:"-" json:"-"`
48+
ID int `json:"-"`
4949
Name string `json:"name"`
50-
Password string `jsonapi:"-" json:"-"`
50+
Password string `json:"-"`
5151
}
5252

5353
func (u User) GetID() string {
@@ -66,14 +66,14 @@ func (u *User) SetID(stringID string) error {
6666
}
6767

6868
type SimplePost struct {
69-
ID string `jsonapi:"-" json:"-"`
69+
ID string `json:"-"`
7070
Title string `json:"title"`
7171
Text string `json:"text"`
72-
Internal string `jsonapi:"-" json:"-"`
72+
Internal string `json:"-"`
7373
Size int `json:"size"`
74-
Created time.Time `jsonapi:"name=created-date" json:"created-date"`
75-
Updated time.Time `jsonapi:"name=updated-date" json:"updated-date"`
76-
topSecret string `jsonapi:"name=top-secret" json:"top-secret"`
74+
Created time.Time `json:"created-date"`
75+
Updated time.Time `json:"updated-date"`
76+
topSecret string `json:"top-secret"`
7777
}
7878

7979
func (s SimplePost) GetID() string {
@@ -87,14 +87,14 @@ func (s *SimplePost) SetID(ID string) error {
8787
}
8888

8989
type Post struct {
90-
ID int `jsonapi:"-" json:"-"`
90+
ID int `json:"-"`
9191
Title string `json:"title"`
92-
Comments []Comment `jsonapi:"-" json:"-"`
93-
CommentsIDs []int `jsonapi:"-" json:"-"`
94-
CommentsEmpty bool `jsonapi:"-" json:"-"`
95-
Author *User `jsonapi:"-" json:"-"`
96-
AuthorID sql.NullInt64 `jsonapi:"-" json:"-"`
97-
AuthorEmpty bool `jsonapi:"-" json:"-"`
92+
Comments []Comment `json:"-"`
93+
CommentsIDs []int `json:"-"`
94+
CommentsEmpty bool `json:"-"`
95+
Author *User `json:"-"`
96+
AuthorID sql.NullInt64 `json:"-"`
97+
AuthorEmpty bool `json:"-"`
9898
}
9999

100100
func (c Post) GetID() string {
@@ -217,9 +217,9 @@ func (c *Post) SetReferencedStructs(references []UnmarshalIdentifier) error {
217217
}
218218

219219
type AnotherPost struct {
220-
ID int `jsonapi:"-" json:"-"`
221-
AuthorID int `jsonapi:"-" json:"-"`
222-
Author *User `jsonapi:"-" json:"-"`
220+
ID int `json:"-"`
221+
AuthorID int `json:"-"`
222+
Author *User `json:"-"`
223223
}
224224

225225
func (p AnotherPost) GetID() string {
@@ -246,7 +246,7 @@ func (p AnotherPost) GetReferencedIDs() []ReferenceID {
246246
}
247247

248248
type ZeroPost struct {
249-
ID string `jsonapi:"-" json:"-"`
249+
ID string `json:"-"`
250250
Title string `json:"title"`
251251
Value zero.Float `json:"value"`
252252
}
@@ -256,7 +256,7 @@ func (z ZeroPost) GetID() string {
256256
}
257257

258258
type ZeroPostPointer struct {
259-
ID string `jsonapi:"-" json:"-"`
259+
ID string `json:"-"`
260260
Title string `json:"title"`
261261
Value *zero.Float `json:"value"`
262262
}
@@ -266,10 +266,10 @@ func (z ZeroPostPointer) GetID() string {
266266
}
267267

268268
type Question struct {
269-
ID string `jsonapi:"-" json:"-"`
269+
ID string `json:"-"`
270270
Text string `json:"text"`
271-
InspiringQuestionID sql.NullString `jsonapi:"-" json:"-"`
272-
InspiringQuestion *Question `jsonapi:"-" json:"-"`
271+
InspiringQuestionID sql.NullString `json:"-"`
272+
InspiringQuestion *Question `json:"-"`
273273
}
274274

275275
func (q Question) GetID() string {
@@ -304,7 +304,7 @@ func (q Question) GetReferencedStructs() []MarshalIdentifier {
304304
}
305305

306306
type Identity struct {
307-
ID int64 `jsonapi:"-"`
307+
ID int64 `json:"-"`
308308
Scopes []string `json:"scopes"`
309309
}
310310

@@ -328,7 +328,7 @@ func (u Unicorn) GetID() string {
328328
}
329329

330330
type NumberPost struct {
331-
ID string `jsonapi:"-"`
331+
ID string `json:"-"`
332332
Title string
333333
Number int64
334334
UnsignedNumber uint64
@@ -341,7 +341,7 @@ func (n *NumberPost) SetID(ID string) error {
341341
}
342342

343343
type SQLNullPost struct {
344-
ID string `jsonapi:"-" json:"-"`
344+
ID string `json:"-"`
345345
Title zero.String `json:"title"`
346346
Likes zero.Int `json:"likes"`
347347
Rating zero.Float `json:"rating"`
@@ -360,11 +360,11 @@ func (s *SQLNullPost) SetID(ID string) error {
360360

361361
type RenamedPostWithEmbedding struct {
362362
Embedded SQLNullPost
363-
ID string `jsonapi:"-" json:"-"`
364-
Another string `jsonapi:"name=another" json:"another"`
365-
Field string `jsonapi:"name=foo" json:"foo"`
366-
Other string `jsonapi:"name=bar-bar" json:"bar-bar"`
367-
Ignored string `jsonapi:"-" json:"-"`
363+
ID string `json:"-"`
364+
Another string `json:"another"`
365+
Field string `json:"foo"`
366+
Other string `json:"bar-bar"`
367+
Ignored string `json:"-"`
368368
}
369369

370370
func (p *RenamedPostWithEmbedding) SetID(ID string) error {

jsonapi/marshal_enum_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (s *PublishStatus) UnmarshalJSON(data []byte) error {
5555
}
5656

5757
type EnumPost struct {
58-
ID string `jsonapi:"-" json:"-"`
58+
ID string `json:"-"`
5959
Title string `json:"title"`
6060
Status PublishStatus `json:"status"`
6161
}

jsonapi/marshal_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,6 @@ var _ = Describe("Marshalling", func() {
739739
"type": "identities",
740740
"id": "1234",
741741
"attributes": {
742-
"ID": 1234,
743742
"scopes": [
744743
"user_global"
745744
]

jsonapi/unmarshal_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ import (
1515
var _ = Describe("Unmarshal", func() {
1616
Context("When unmarshaling simple objects", func() {
1717
t, _ := time.Parse(time.RFC3339, "2014-11-10T16:30:48.823Z")
18-
/*
19-
*singleJSON := []byte(`{"data":{"id": "1", "type": "simplePosts", "attributes": {"title":"First Post","text":"Lipsum", "Created": "2014-11-10T16:30:48.823Z"}}}`)
20-
*/
2118
firstPost := SimplePost{ID: "1", Title: "First Post", Text: "Lipsum", Created: t}
2219
secondPost := SimplePost{ID: "2", Title: "Second Post", Text: "Foobar!", Created: t, Updated: t}
2320

0 commit comments

Comments
 (0)