Commit Graph

212 Commits

Author SHA1 Message Date
Sam Woodard 6bf44faa3c return function return value when is only err 2018-10-16 07:33:23 -07:00
Sam Woodard 9246c912f5
Merge pull request #159 from shwoodard/shwoodard-defined-type-attributes
Add support for attributes of custom defined types
2018-10-15 16:24:20 -07:00
Sam Woodard e22856db88 add documentation for primative custom types only 2018-10-11 09:08:03 -07:00
Sam Woodard 1947fea11f wrote failing test for example so removing from docs 2018-10-11 09:04:55 -07:00
Sam Woodard 906357051e run gofmt on package 2018-10-11 04:47:50 -07:00
Sam Woodard d9a610774a
Merge pull request #160 from google/fix-readme-typos
Fix typos
2018-10-05 12:57:15 -07:00
Sam Woodard 941c167d93
Fix typo "the the" 2018-10-05 12:52:00 -07:00
Sam Woodard 43592a3ebe
Fix typos 2018-10-05 12:50:13 -07:00
Sam Woodard ed08d4f02a refactor, consistency, add test to ensure we don't need additional type check 2018-10-05 08:57:33 -07:00
Sam Woodard d05fcd97df one line method removed 2018-10-05 08:56:32 -07:00
Sam Woodard ab24913148 adjust test so values are like from a json payload 2018-10-05 07:29:18 -07:00
CrushedPixel 87c6b8e5b5 Fixed format types 2018-10-05 07:29:06 -07:00
CrushedPixel ccac636b4b Add support for attributes of custom defined types 2018-10-05 07:10:00 -07:00
Sam Woodard 5307399ec1 add new go version to travis and remove oldest (#158) 2018-10-04 13:56:12 -07:00
Sam Woodard bdc73a22a3
Merge pull request #99 from Slemgrim/master
Unmarshalling of nested structs
2018-10-04 12:04:27 -07:00
Markus Ritberger 417d4eb8fb
Merge pull request #6 from shwoodard/shwoodard-slemgrim-pull-99
Use jsonapi struct tags for nested attrs
2018-10-04 18:04:16 +02:00
Sam Woodard 3c8221b373 use jsonapi tags for nested attrs 2018-10-03 13:51:04 -07:00
Stuart Auld 3b9f84a311 Added README to explain how to support custom types (#149) (#150)
* Added README to explain how to support custom types (#149)

* Fix incorrect docstring
2018-08-21 14:31:52 -07:00
Ilya Baturin 5d047c6bc6 fixes issue with slice of nil pointers (#144)
fixes panic in case of marshaling of slice of nils like `[]*<SomeType>{nil, nil}`
2018-06-17 19:19:26 -07:00
Markus Ritberger 8b7e0bc2c0
Merge pull request #5 from Slemgrim/refactor-ptr-error
Refactor ptr error and cleanup
2018-03-14 21:47:34 +01:00
Markus Ritberger d490a0f637 remove whitespaces and stick to 80chars 2018-03-14 21:43:51 +01:00
Markus Ritberger 72f7bad5b3 check for ptr error type in tests 2018-03-14 21:43:24 +01:00
Markus Ritberger 9bc94d8c70 replace public function with custom error type 2018-03-14 20:52:27 +01:00
Sam Woodard 2dcc18f436
Merge pull request #133 from google/u/aren55555/remove-scripts-dir
Remove the script dir, the readme documents a way to run the example …
2018-03-12 18:38:58 -07:00
Aren Patel 8127e1640e
Remove the script dir, the readme documents a way to run the example without using script/example. 2018-03-12 18:24:05 -07:00
Igor Zibarev 103c21c224 Fix omitempty for attributes (#119)
* Fix omitempty for attributes

Fix panic on omitempty field for attribute that is not of
a primitive type.

Fixes #103

* Add more types for omitempty test
2018-03-12 18:15:16 -07:00
Sam Woodard 6600c8fdc1 Remove funky go structure paths and add examples bin (#132) 2018-03-12 18:01:40 -07:00
Sam Woodard 1ac83a4625 Add go 1.10 to .travis.yml (#131) 2018-03-12 17:55:56 -07:00
Stratos Neiros bf4e01db8d Use go build instead of go run for example app (#127)
Using go run $GOPATH/src/github.com/google/jsonapi/examples/app.go as
shown in the Readme, leads to errors (#126) since go run requires all
the .go files of a program.

This commit changes the Readme to show how to run the example app using
go build to avoid this issue.
2018-03-12 17:54:39 -07:00
Markus Ritberger e428b86c25
Merge pull request #4 from msabramo/fix-test-failures
Fix test failures
2018-01-25 16:51:16 +01:00
Marc Abramowitz 7c2ceac7c5 Fix test failures 2018-01-25 07:28:20 -08:00
Markus Ritberger 21b4945ad6
Merge pull request #3 from msabramo/pr-99-make-nested-struct-ptr-work
Make nested struct pointers work
2018-01-22 12:11:07 +01:00
Markus Ritberger bb266b4483
Merge pull request #2 from msabramo/pr-99-show-type-for-ErrUnsupportedPtrType
Show type for ErrUnsupportedPtrType
2018-01-22 08:33:37 +01:00
Markus Ritberger 339909da0d
Merge pull request #1 from msabramo/msabramo-pr-99
Test more things in TestUnmarshalNestedStruct
2018-01-22 08:10:08 +01:00
Marc Abramowitz a3b3bb2cb5 Show type for ErrUnsupportedPtrType
to aid in troubleshooting.

Before:

```
Pointer type in struct is not supported
```

After:

```
jsonapi: Can't unmarshal true (bool) to struct field `Name`, which is a pointer to `string`
```
2018-01-17 13:38:32 -08:00
Marc Abramowitz 16e19ab9f9 Make nested struct pointers work 2018-01-17 13:02:30 -08:00
Marc Abramowitz b28beab7f3 Add TestUnmarshalNestedStructPtr 2018-01-17 13:02:30 -08:00
Marc Abramowitz e3c0871f34 Test more things in TestUnmarshalNestedStruct 2018-01-17 08:12:59 -08:00
Slemgrim 0400041771 fix wrong type for formatting 2017-11-21 19:15:24 +08:00
Slemgrim a6577dfae8 Add more speaking tests
tests should have an expected outcome vs. an actual outcome to make them easier to debug
2017-11-21 19:05:50 +08:00
Slemgrim 7e5c9014d9 Merge remote-tracking branch 'upstream/master' 2017-11-21 18:42:48 +08:00
Sam Woodard e0fc4eed33
Merge pull request #118 from themccallister/patch-1
Add tests for mismatching accept headers
2017-11-08 09:49:09 -08:00
Jason McCallister 081fb8a5c2 Add additional test for method not found 2017-10-23 22:46:32 -04:00
Jason McCallister c036316c9d Add tests for mismatching accept headers 2017-10-23 22:41:44 -04:00
Aren Patel a06052dd83
Run gofmt -s to simplifiy. 2017-09-13 12:59:59 -07:00
Aren Patel 8d89a9020f
Fix comment. 2017-09-13 12:56:47 -07:00
Aren Patel 2ce5c379b0
Address go lint comments for the examples. 2017-09-13 12:56:01 -07:00
Aren Patel 5e0c586099
Corrected spelling mistakes. 2017-09-13 12:52:31 -07:00
Aren Patel 3b01bb5fe6
Added go report card. 2017-09-13 12:49:52 -07:00
Aren Patel 3e6ead0f9d
Test against 1.9 2017-09-05 11:11:09 -04:00