You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Split WKT repr into a separate table.
- Push field names discussion into a paragraph instead of trying to cram it into the table.
- Correct table header to use <thead> semantic tag type (the cells were already <th> so this is only a nitpick)
PiperOrigin-RevId: 861738414
<td>Generates JSON objects. Message field names are mapped to
68
-
lowerCamelCase and become JSON object keys. If the
69
-
<code>json_name</code> field option is specified, the specified value
70
-
will be used as the key instead. Parsers accept both the lowerCamelCase
71
-
name (or the one specified by the <code>json_name</code> option) and the
72
-
original proto field name. <code>null</code> is an accepted value for
73
-
all field types and leaves the field unset. <code>\0 (nul)</code> cannot
74
-
be used within a <code>json_name</code> value. For more on why, see
75
-
<a href="/news/2023-04-28#json-name">Stricter validation for json_name</a>.
69
+
<td>Generates JSON objects.
70
+
<p>
71
+
Keys are serialized as lowerCamelCase of field name. See
72
+
<a href="#field-names">Field Names</a> for more special cases regarding mapping of field names
73
+
to object keys.
74
+
<p>
75
+
Well-known types have special representations, as described in the <a href="#wkt">Well-known types table</a>.
76
+
<p>
77
+
<code>null</code> is valid for any field and leaves the field unset. See <a href="null-values">Null Values</a> for clarification about the semantic behavior of null values.
76
78
</td>
77
79
</tr>
78
80
<tr>
@@ -87,13 +89,13 @@ The following table shows how data is represented in JSON files.
87
89
<td>map<K,V></td>
88
90
<td>object</td>
89
91
<td><code>{"k": v, ...}</code></td>
90
-
<td>All keys are converted to strings (keys in JSON spec can only be strings).</td>
92
+
<td>All keys are converted to strings (object keys in JSON can only be strings).</td>
91
93
</tr>
92
94
<tr>
93
95
<td>repeated V</td>
94
96
<td>array</td>
95
97
<td><code>[v, ...]</code></td>
96
-
<td><code>null</code> is accepted as the empty list <code>[]</code>.</td>
98
+
<td></td>
97
99
</tr>
98
100
<tr>
99
101
<td>bool</td>
@@ -121,7 +123,7 @@ The following table shows how data is represented in JSON files.
121
123
<td>number</td>
122
124
<td><code>1, -10, 0</code></td>
123
125
<td>JSON value will be a decimal number. Either numbers or strings are
124
-
accepted. Empty strings are invalid. Exponent notation (such as `1e2`) is
126
+
accepted. Empty strings are invalid. Exponent notation (such as <code>1e2</code>) is
125
127
accepted in both quoted and unquoted forms.
126
128
</td>
127
129
</tr>
@@ -130,7 +132,7 @@ The following table shows how data is represented in JSON files.
130
132
<td>string</td>
131
133
<td><code>"1", "-10"</code></td>
132
134
<td>JSON value will be a decimal string. Either numbers or strings are
133
-
accepted. Empty strings are invalid. Exponent notation (such as `1e2`) is
135
+
accepted. Empty strings are invalid. Exponent notation (such as <code>1e2</code>) is
134
136
accepted in both quoted and unquoted forms.
135
137
</td>
136
138
</tr>
@@ -143,19 +145,41 @@ The following table shows how data is represented in JSON files.
143
145
Empty strings are invalid. Exponent notation is also accepted.
144
146
</td>
145
147
</tr>
148
+
</tbody>
149
+
<table>
150
+
151
+
<!-- This section html instead of markdown as workaround to bug that escapes all html between the first and last table -->
152
+
<h3id="wkt">Well-Known Types</h3>
153
+
154
+
<p>Some messages in the <code>google.protobuf</code> package have a special representation
155
+
when represented in JSON.
156
+
157
+
<p>No message type outside of the <code>google.protobuf</code> package has a special ProtoJSON
158
+
handling; for example, types in <code>google.types</code> package are represented with the
0 commit comments