diff options
author | Wouter van Oortmerssen <wvo@google.com> | 2016-01-08 15:18:51 -0800 |
---|---|---|
committer | Wouter van Oortmerssen <wvo@google.com> | 2016-01-19 14:05:27 -0800 |
commit | 049f3f7907e9fc8eb1ecd7c3775139de65552585 (patch) | |
tree | 6723a14f75b7bf9b6d1b42064d5927a90c96b572 /docs | |
parent | e848137ded3524c60faa6def429807faae5340e0 (diff) | |
download | flatbuffers-049f3f7907e9fc8eb1ecd7c3775139de65552585.tar.gz flatbuffers-049f3f7907e9fc8eb1ecd7c3775139de65552585.tar.bz2 flatbuffers-049f3f7907e9fc8eb1ecd7c3775139de65552585.zip |
Added support for parsing JSON null value.
These cause the field in question to be skipped.
Bug: 16550393
Change-Id: Id05104e89818ee773b8a91fdcc86e18061b9a82f
Tested: on Linux.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/html/md__schemas.html | 1 | ||||
-rwxr-xr-x | docs/source/Schemas.md | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/docs/html/md__schemas.html b/docs/html/md__schemas.html index fe7f5635..de7969cb 100644 --- a/docs/html/md__schemas.html +++ b/docs/html/md__schemas.html @@ -166,6 +166,7 @@ root_type Monster; <li>It accepts field names with and without quotes, like many JSON parsers already do. It outputs them without quotes as well, though can be made to output them using the <code>strict_json</code> flag.</li> <li>If a field has an enum type, the parser will recognize symbolic enum values (with or without quotes) instead of numbers, e.g. <code>field: EnumVal</code>. If a field is of integral type, you can still use symbolic names, but values need to be prefixed with their type and need to be quoted, e.g. <code>field: "Enum.EnumVal"</code>. For enums representing flags, you may place multiple inside a string separated by spaces to OR them, e.g. <code>field: "EnumVal1 EnumVal2"</code> or <code>field: "Enum.EnumVal1 Enum.EnumVal2"</code>.</li> <li>Similarly, for unions, these need to specified with two fields much like you do when serializing from code. E.g. for a field <code>foo</code>, you must add a field <code>foo_type: FooOne</code> right before the <code>foo</code> field, where <code>FooOne</code> would be the table out of the union you want to use.</li> +<li>A field that has the value <code>null</code> (e.g. <code>field: null</code>) is intended to have the default value for that field (thus has the same effect as if that field wasn't specified at all).</li> </ul> <p>When parsing JSON, it recognizes the following escape codes in strings:</p> <ul> diff --git a/docs/source/Schemas.md b/docs/source/Schemas.md index 8d4348cb..36bebf17 100755 --- a/docs/source/Schemas.md +++ b/docs/source/Schemas.md @@ -313,6 +313,9 @@ JSON: you do when serializing from code. E.g. for a field `foo`, you must add a field `foo_type: FooOne` right before the `foo` field, where `FooOne` would be the table out of the union you want to use. +- A field that has the value `null` (e.g. `field: null`) is intended to + have the default value for that field (thus has the same effect as if + that field wasn't specified at all). When parsing JSON, it recognizes the following escape codes in strings: |