diff options
author | Wouter van Oortmerssen <wvo@google.com> | 2015-01-07 13:57:09 -0800 |
---|---|---|
committer | Wouter van Oortmerssen <wvo@google.com> | 2015-01-07 15:42:43 -0800 |
commit | b929c62c71de3977a5e032aafe07468edbee9a58 (patch) | |
tree | f4d5eaea42941af08d656cf47099525bb09802e0 /docs | |
parent | 3ec8d7f598b0319dc845830116252f051b45b2bc (diff) | |
download | flatbuffers-b929c62c71de3977a5e032aafe07468edbee9a58.tar.gz flatbuffers-b929c62c71de3977a5e032aafe07468edbee9a58.tar.bz2 flatbuffers-b929c62c71de3977a5e032aafe07468edbee9a58.zip |
Added clarification about unions in JSON to the docs.
Change-Id: I1f310636f8b74366b5b0fc73c7e106424583fc93
Diffstat (limited to 'docs')
-rw-r--r-- | docs/html/md__schemas.html | 1 | ||||
-rwxr-xr-x | docs/source/Schemas.md | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/docs/html/md__schemas.html b/docs/html/md__schemas.html index aee2bd09..f7c39efb 100644 --- a/docs/html/md__schemas.html +++ b/docs/html/md__schemas.html @@ -153,6 +153,7 @@ root_type Monster; <ul> <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> </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 1329f9ee..7f8b0a14 100755 --- a/docs/source/Schemas.md +++ b/docs/source/Schemas.md @@ -298,6 +298,10 @@ JSON: representing flags, you may place multiple inside a string separated by spaces to OR them, e.g. `field: "EnumVal1 EnumVal2"` or `field: "Enum.EnumVal1 Enum.EnumVal2"`. +- Similarly, for unions, these need to specified with two fields much like + 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. When parsing JSON, it recognizes the following escape codes in strings: |