@@ -12,9 +12,9 @@ This page specifies the format, but a number of additional edge cases which
1212define a conformant ProtoJSON parser are covered in the Protobuf Conformance
1313Test Suite and are not exhaustively detailed here.
1414
15- # Non-goals of the Format {#non-goals}
15+ ## Non-goals of the Format {#non-goals}
1616
17- ## Cannot Represent Some JSON schemas {#non-goals-arbitrary-json-schema}
17+ ### Cannot Represent Some JSON schemas {#non-goals-arbitrary-json-schema}
1818
1919The ProtoJSON format is designed to be a JSON representation of schemas which
2020are expressible in the Protobuf schema language.
@@ -30,14 +30,14 @@ It is possible to use `google.protobuf.Struct` and `google.protobuf.Value` types
3030to allow arbitrary JSON to be parsed into a Protobuf schema, but these only
3131allow you to capture the values as schemaless unordered key-value maps.
3232
33- ## Not as efficient as the binary wire format {#non-goals-highly-efficient}
33+ ### Not as efficient as the binary wire format {#non-goals-highly-efficient}
3434
3535ProtoJSON Format is not as efficient as binary wire format and never will be.
3636
3737The converter uses more CPU to encode and decode messages and (except in rare
3838cases) encoded messages consume more space.
3939
40- ## Does not have as good schema-evolution guarantees as binary wire format {#non-goals-optimal-schema-evolution}
40+ ### Does not have as good schema-evolution guarantees as binary wire format {#non-goals-optimal-schema-evolution}
4141
4242ProtoJSON format does not support unknown fields, and it puts field and enum
4343value names into encoded messages which makes it much harder to change those
4646
4747See [ JSON Wire Safety] ( #json-wire-safety ) below for more details.
4848
49- # Format Description {#format}
49+ ## Format Description {#format}
5050
51- ## Representation of each type {#field-representation}
51+ ### Representation of each type {#field-representation}
5252
5353The following table shows how data is represented in JSON files.
5454
@@ -245,7 +245,7 @@ neutral representation.
245245 </tbody >
246246</table >
247247
248- ## Field names as JSON keys {#field-names}
248+ ### Field names as JSON keys {#field-names}
249249
250250Message field names are mapped to lowerCamelCase to be used as JSON object keys.
251251If the ` json_name ` field option is specified, the specified value will be used
@@ -262,7 +262,7 @@ back by all spec parsers.
262262for json_name</a >. Note that ` \0 ` is still considered a legal character within
263263the value of a ` string ` field.
264264
265- ## Presence and default-values {#presence}
265+ ### Presence and default-values {#presence}
266266
267267When generating JSON-encoded output from a protocol buffer, if a field supports
268268presence, serializers must emit the field value if and only if the corresponding
@@ -273,7 +273,7 @@ example any empty repeated field) serializers should omit it from the output. An
273273implementation may provide options to include fields with default values in the
274274output.
275275
276- ## Null values {#null-values}
276+ ### Null values {#null-values}
277277
278278Serializers should not emit ` null ` values.
279279
@@ -298,7 +298,7 @@ must be handled by serializers and parsers under the standard presence behavior.
298298This behavior correspondingly allows ` google.protobuf.Struct ` and
299299` google.protobuf.Value ` to losslessly round trip arbitrary JSON.
300300
301- ## Duplicate values {#duplicate-values}
301+ ### Duplicate values {#duplicate-values}
302302
303303Serializers must never serialize the same field multiple times, nor multiple
304304different cases in the same oneof in the same JSON object.
@@ -314,7 +314,7 @@ may be impractical or infeasible, so it is strongly recommended that systems
314314avoid relying on specific behavior for duplicate fields in ProtoJSON where
315315possible.
316316
317- ## Out of range numeric values
317+ ### Out of range numeric values
318318
319319When parsing a numeric value, if the number that is is parsed from the wire
320320doesn't fit in the corresponding type, the parser should fail to parse.
0 commit comments