Skip to content

Commit 100f330

Browse files
authored
Merge pull request #16 from hashicorp/brandonc/degooglifiy
De-google the README and link to our own godocs site
2 parents 360ddf0 + 4d8a31f commit 100f330

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

README.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# jsonapi
22

3-
[![Build Status](https://travis-ci.org/google/jsonapi.svg?branch=master)](https://travis-ci.org/google/jsonapi)
4-
[![Go Report Card](https://goreportcard.com/badge/github.com/google/jsonapi)](https://goreportcard.com/report/github.com/google/jsonapi)
5-
[![GoDoc](https://godoc.org/github.com/google/jsonapi?status.svg)](http://godoc.org/github.com/google/jsonapi)
6-
[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)
3+
![Build Status](https://github.com/hashicorp/jsonapi/actions/workflows/ci.yml/badge.svg?main)
4+
![Go Report Card](https://goreportcard.com/badge/github.com/hashicorp/jsonapi)
5+
![GoDoc](https://godoc.org/github.com/hashicorp/jsonapi?status.svg)
76

87
A serializer/deserializer for JSON payloads that comply to the
9-
[JSON API - jsonapi.org](http://jsonapi.org) spec in go.
10-
8+
[JSON API - jsonapi.org](http://jsonapi.org) v1.1 spec in go.
119

10+
This package was forked from [google/jsonapi](https://github.com/google/jsonapi) and
11+
adds several enhancements such as [links](#links) and [polymorphic relationships](#polyrelation).
1212

1313
## Installation
1414

1515
```
16-
go get -u github.com/google/jsonapi
16+
go get -u github.com/hashicorp/jsonapi
1717
```
1818

1919
Or, see [Alternative Installation](#alternative-installation).
@@ -91,9 +91,9 @@ To run,
9191
* Make sure you have [Go installed](https://golang.org/doc/install)
9292
* Create the following directories or similar: `~/go`
9393
* Set `GOPATH` to `PWD` in your shell session, `export GOPATH=$PWD`
94-
* `go get github.com/google/jsonapi`. (Append `-u` after `get` if you
94+
* `go get github.com/hashicorp/jsonapi`. (Append `-u` after `get` if you
9595
are updating.)
96-
* `cd $GOPATH/src/github.com/google/jsonapi/examples`
96+
* `cd $GOPATH/src/github.com/hashicorp/jsonapi/examples`
9797
* `go build && ./examples`
9898

9999
## `jsonapi` Tag Reference
@@ -234,9 +234,6 @@ struct. When accepting input values on this type of choice type, it would a good
234234
and check that the value is set on only one field.
235235

236236
#### `links`
237-
238-
*Note: This annotation is an added feature independent of the canonical google/jsonapi package*
239-
240237
```
241238
`jsonapi:"links,omitempty"`
242239
```
@@ -256,7 +253,7 @@ about the rest?
256253
### Create Record Example
257254

258255
You can Unmarshal a JSON API payload using
259-
[jsonapi.UnmarshalPayload](http://godoc.org/github.com/google/jsonapi#UnmarshalPayload).
256+
[jsonapi.UnmarshalPayload](http://godoc.org/github.com/hashicorp/jsonapi#UnmarshalPayload).
260257
It reads from an [io.Reader](https://golang.org/pkg/io/#Reader)
261258
containing a JSON API payload for one record (but can have related
262259
records). Then, it materializes a struct that you created and passed in
@@ -265,7 +262,7 @@ the top level, in request payloads at the moment. Bulk creates and
265262
updates are not supported yet.
266263

267264
After saving your record, you can use,
268-
[MarshalOnePayload](http://godoc.org/github.com/google/jsonapi#MarshalOnePayload),
265+
[MarshalOnePayload](http://godoc.org/github.com/hashicorp/jsonapi#MarshalOnePayload),
269266
to write the JSON API response to an
270267
[io.Writer](https://golang.org/pkg/io/#Writer).
271268

@@ -275,15 +272,15 @@ to write the JSON API response to an
275272
UnmarshalPayload(in io.Reader, model interface{})
276273
```
277274

278-
Visit [godoc](http://godoc.org/github.com/google/jsonapi#UnmarshalPayload)
275+
Visit [godoc](http://godoc.org/github.com/hashicorp/jsonapi#UnmarshalPayload)
279276

280277
#### `MarshalPayload`
281278

282279
```go
283280
MarshalPayload(w io.Writer, models interface{}) error
284281
```
285282

286-
Visit [godoc](http://godoc.org/github.com/google/jsonapi#MarshalPayload)
283+
Visit [godoc](http://godoc.org/github.com/hashicorp/jsonapi#MarshalPayload)
287284

288285
Writes a JSON API response, with related records sideloaded, into an
289286
`included` array. This method encodes a response for either a single record or
@@ -319,7 +316,7 @@ func CreateBlog(w http.ResponseWriter, r *http.Request) {
319316
UnmarshalManyPayload(in io.Reader, t reflect.Type) ([]interface{}, error)
320317
```
321318

322-
Visit [godoc](http://godoc.org/github.com/google/jsonapi#UnmarshalManyPayload)
319+
Visit [godoc](http://godoc.org/github.com/hashicorp/jsonapi#UnmarshalManyPayload)
323320

324321
Takes an `io.Reader` and a `reflect.Type` representing the uniform type
325322
contained within the `"data"` JSON API member.
@@ -485,7 +482,7 @@ if err := validate(&myStructToValidate); err != nil {
485482
MarshalOnePayloadEmbedded(w io.Writer, model interface{}) error
486483
```
487484

488-
Visit [godoc](http://godoc.org/github.com/google/jsonapi#MarshalOnePayloadEmbedded)
485+
Visit [godoc](http://godoc.org/github.com/hashicorp/jsonapi#MarshalOnePayloadEmbedded)
489486

490487
This method is not strictly meant to for use in implementation code,
491488
although feel free. It was mainly created for use in tests; in most cases,

0 commit comments

Comments
 (0)