Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when i compiled a proto file with a map, occer error #799

Closed
ghost opened this issue Sep 6, 2015 · 3 comments
Closed

when i compiled a proto file with a map, occer error #799

ghost opened this issue Sep 6, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 6, 2015

use protoc-2.6.1-win32/protoc.exe

proto file :

message Config { 
    map<string, string> biyun_levels = 1;
}

error:

config.proto:5:5: Expected "required", "optional", or "repeated".
config.proto:5:8: Expected field name.

in the doucment, it says protobuf2 supports Maps, but this error is why?

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Sep 7, 2015

The maps syntax is only supported starting from v3.0.0. The "proto2" in the doc is referring to the syntax version, not protobuf release version. v3.0.0 supports both proto2 syntax and proto3 syntax while v2.6.1 only supports proto2 syntax. For all users, it's recommended to use v3.0.0-beta-1 instead of v2.6.1.

@ghost ghost closed this as completed Sep 10, 2015
@LazyPlanet
Copy link

The generated map API is currently available for all proto2 supported languages. You can find out more about the map API for your chosen language in the relevant API reference.

@LazyPlanet
Copy link

does 2.6.1 support map?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants