Skip to content

Commit 6dde7f8

Browse files
committed
Fix footnotes and update comment on google well known types.
1 parent acaf013 commit 6dde7f8

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ The main features include:
2525
| ------- | ------------------- | ------------ | --------------- |
2626
| Ocaml types | Supported | Supported | Defined runtime[^1] |
2727
| Service endpoints | Supported | Supported | N/A |
28-
| proto3 | Supported | Supported[^3] | Supported |
29-
| proto2 | Supported | Supported[^3] | Supported |
28+
| proto3 | Supported | Supported[^2] | Supported |
29+
| proto2 | Supported | Supported[^2] | Supported |
3030
| proto2 extends | Supported | Ignored | Supported |
31-
| proto2 groups | Not supported[^2] | Ignored | ? |
31+
| proto2 groups | Not supported[^3] | Ignored | ? |
3232
| json mappings | Supported | Supported | ? |
3333

34-
[^1] Ocaml-bp has a sister project `Ocaml-bp-plugin` which emit
34+
[^1]: Ocaml-bp has a sister project `Ocaml-bp-plugin` which emit
3535
Ocaml-pb definitions from a `.proto`. The plugin parses files are proto2
3636
Ocaml type definitions (all fields are option types), and repeated
3737
fields are not packed by default.
3838

39-
[^2] Groups has been deprecated by google and should not be used.
40-
41-
[^3] `ocaml_protoc` will always transmit all fields that are not
39+
[^2]: `ocaml_protoc` will always transmit all fields that are not
4240
marked optional, and does not *strictly* comply to the protobuf
4341
specification.
4442

43+
[^3]: Groups has been deprecated by google and should not be used.
44+
4545

4646
## Types
4747
Basic types are mapped trivially to Ocaml types:
@@ -50,14 +50,14 @@ Primitive types:
5050

5151
| Protobuf Type | Ocaml type |
5252
| ------------- | ---------- |
53-
| int32, int64, uint32, uint64, sint32, sint64 | int[^5] |
54-
| fixed64, sfixed64, fixed32, sfixed32 | int32, int64[^5] |
53+
| int32, int64, uint32, uint64, sint32, sint64 | int[^4] |
54+
| fixed64, sfixed64, fixed32, sfixed32 | int32, int64[^4] |
5555
| bool | bool |
5656
| float, double | float |
5757
| string | string |
5858
| bytes | bytes |
5959

60-
[^5] The plugin supports changing the type for scalar types to
60+
[^4]: The plugin supports changing the type for scalar types to
6161
int/int64/int32. See options section below.
6262

6363
A message <name> declaration is compiled to a module <Name> with a record type
@@ -116,16 +116,15 @@ can generate the Ocaml code by running
116116
| int32\_as\_int | Map \*int32 types to int instead of `int32` | `int32_as_int=false` | true |
117117
| fixed\_as\_int | Map \*fixed\* types to `int` | `fixed_as_int=true` | false |
118118
| singleton\_record | Messages with only one field will be wrapped in a record | `singleton_record=true` | false |
119-
| prefix\_output\_with\_package | Emit files prefixed with their package name. This allows multiple protofiles of the same name with different package names to be used | `prefix_output_with_package=true`[^6] | false |
119+
| prefix\_output\_with\_package | Emit files prefixed with their package name. This allows multiple protofiles of the same name with different package names to be used | `prefix_output_with_package=true`[^5] | false |
120120
| singleton\_oneof\_as\_option | Oneof declarations only containing one field are mapped to a single optional field | singleton\_oneof\_as\_option=false | true |
121121

122122
Parameters are separated by `;`
123123

124-
[^6] When using this option, all dependencies needs to be compiled
124+
[^5]: When using the `prefix_output_with_package=true` option, all dependencies needs to be compiled
125125
using this option as well. E.g. if the protobuf file dependes on
126-
*google well known types*, you will need to rebuild using
127-
`prefix_output_with_package=true` as
128-
well. This dune file
126+
*google well-known types*, you will need to rebuild using
127+
`prefix_output_with_package=true` as well. This dune file
129128
[dune](https://github.com/andersfugmann/ocaml-protoc-plugin/blob/main/test/test_params/google_types_prefixed/dune)
130129
lists how to do that.
131130

@@ -373,6 +372,9 @@ from the distribution to your own project, and make alterations
373372
there. See the [echo\_deriving](https://github.com/andersfugmann/ocaml-protoc-plugin/tree/main/examples/echo_deriving)
374373
example on how to do this.
375374

375+
Its important that all protobuf files are compiled with the same
376+
flags, including the *Google Well-Known types*. See [^5]
377+
376378
# Example
377379

378380
`test.proto`

0 commit comments

Comments
 (0)