Skip to content

Commit

Permalink
README (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbus authored Jul 24, 2020
1 parent eded996 commit 519eb3f
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Client-customizable JSON formats for dynamic APIs.


## Introduction

dynjson allow APIs to return only fields selected by the API client :
Expand All @@ -25,7 +24,7 @@ The field order is the same as the select parameters.

go get github.com/cocoonspace/dynjson

## Usage
## Examples

```go
type APIResult struct {
Expand Down Expand Up @@ -107,11 +106,12 @@ if err != nil {
err := json.Marshal(w, o) // {"foo": 1, "bar":[{"barfoo": 1}]}
```

# Anonymous fields
## Limitations

Anonymous fields without a json tag are not supported.
* Anonymous fields without a json tag (embedded by the Go JSON encoder in the enclosing struct) are not supported,
* Maps are copied as is, you cannot filter map contents using `map_field_name.map_key`.

# Performance impact
## Performance impact

```
BenchmarkFormat_Fields
Expand All @@ -122,6 +122,12 @@ BenchmarkRawJSON
BenchmarkRawJSON-8 5351313 223 ns/op 32 B/op 1 allocs/op
```

# License
## Contribution guidelines

Contributions are welcome, as long as :
* unit tests & comments are included,
* no external package is used.

## License

MIT - See LICENSE

0 comments on commit 519eb3f

Please sign in to comment.