Skip to content

Commit 12e4efd

Browse files
committed
Update docs
1 parent 22d1b31 commit 12e4efd

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

modules/docs/markdown/02.1-serialisation/json.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,19 @@ The options available through `JsoniterCodecCompiler` are:
7171
Changes the behaviour of the decoders so that they fail after a certain number of elements when decoding arrays and maps.
7272
This allows to protect against some DDOS attacks.
7373

74-
### withExplicitDefaultsEncoding
74+
## withFieldFilter
75+
76+
**default**: FieldFilter.Default
77+
78+
Changes the behaviour of Json encoders. Can be used to skip empty collections or unset optional fields to reduce the size of the final json.
79+
The default behavior skips unset optional fields or optional fields that have their value equal to the default value.
80+
81+
### withExplicitDefaultsEncoding (deprecated)
7582

7683
**default**: false
7784

85+
This method is deprecated use `withFieldFilter` instead.
86+
7887
Changes the behaviour of Json encoders so that optional values are encoded as
7988
explicit Json null values.
8089

modules/docs/markdown/03-protocols/04-simple-rest-json/01-overview.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -60,31 +60,31 @@ structure Greeting {
6060

6161
This protocol and its interpreters, are aware of the following traits provided out of the box:
6262

63-
- [all simple shapes](https://awslabs.github.io/smithy/1.0/spec/core/model.html#simple-shapes)
64-
- composite data shapes, including collections, unions, structures.
65-
- [operations and services](https://awslabs.github.io/smithy/1.0/spec/core/model.html#service)
66-
- [enumerations](https://awslabs.github.io/smithy/1.0/spec/core/constraint-traits.html#enum-trait)
67-
- [error trait](https://awslabs.github.io/smithy/1.0/spec/core/type-refinement-traits.html#error-trait)
68-
- [http traits](https://awslabs.github.io/smithy/1.0/spec/core/http-traits.html)
69-
- [timestampFormat trait](https://awslabs.github.io/smithy/1.0/spec/core/protocol-traits.html?highlight=timestampformat#timestampformat-trait)
63+
* [all simple shapes](https://awslabs.github.io/smithy/1.0/spec/core/model.html#simple-shapes)
64+
* composite data shapes, including collections, unions, structures.
65+
* [operations and services](https://awslabs.github.io/smithy/1.0/spec/core/model.html#service)
66+
* [enumerations](https://awslabs.github.io/smithy/1.0/spec/core/constraint-traits.html#enum-trait)
67+
* [error trait](https://awslabs.github.io/smithy/1.0/spec/core/type-refinement-traits.html#error-trait)
68+
* [http traits](https://awslabs.github.io/smithy/1.0/spec/core/http-traits.html)
69+
* [timestampFormat trait](https://awslabs.github.io/smithy/1.0/spec/core/protocol-traits.html?highlight=timestampformat#timestampformat-trait)
7070

7171
For the full list, see below.
7272

7373
## Decoding and encoding unions
7474

7575
The `SimpleRestJson` protocol supports 3 different union encodings :
7676

77-
- tagged (default)
78-
- untagged
79-
- discriminated
77+
* tagged (default)
78+
* untagged
79+
* discriminated
8080

8181
See the section about [unions](../../04-codegen/02-unions.md) for a detailed description.
8282

8383
## Json Array Arity
8484

85-
- By default there is a limit on the arity of an array, which is 1024. This is to prevent the server from being overloaded with a large array as this is a vector for attacks.
86-
- This limit can be changed by setting the maxArity `smithy4s.http4s.SimpleRestJsonBuilder.withMaxArity(.)` to the desired value.
87-
- an example can be seen in the [client example](03-client.md)
85+
* By default there is a limit on the arity of an array, which is 1024. This is to prevent the server from being overloaded with a large array as this is a vector for attacks.
86+
* This limit can be changed by setting the maxArity `smithy4s.http4s.SimpleRestJsonBuilder.withMaxArity(.)` to the desired value.
87+
* an example can be seen in the [client example](03-client.md)
8888

8989
## Field Filtering and Explicit Null Encoding
9090

0 commit comments

Comments
 (0)