Giter Club home page Giter Club logo

Comments (7)

codingforeternity avatar codingforeternity commented on June 3, 2024 5

@spluxx any updates on this ? I am facing the same issue.

from protoman.

ahmad-pepperstone avatar ahmad-pepperstone commented on June 3, 2024 3

Same here

from protoman.

spluxx avatar spluxx commented on June 3, 2024

Hmm that's strange. To best of my knowledge, enum values in protobuf are serialized as numbers rather than strings. Could you provide me a snippet of the .proto file and how you're constructing your message?

from protoman.

freshcn avatar freshcn commented on June 3, 2024

I have two .proto file

backend/server/status/get.proto

syntax = "proto3";
package backend.server.status;

option go_package = "backend/app/pb/server/status";

import "backend/public/responseHead.proto";
import "backend/public/platform.proto";

message GetResponse {
    backend.public.ResponseHead head = 1;
    backend.public.Platform platform = 2;
}

backend/public/platform.proto

syntax = "proto3";
package backend.public;

option go_package = "backend/app/pb/public";

enum Platform {
    PLATFORM_EMAIL = 0;
    PLATFORM_WXMINI = 1;
    PLATFORM_WXH5 = 2;
    PLATFORM_MOBILE = 3;
}

An error occurred on the platform in GetResponse

from protoman.

spluxx avatar spluxx commented on June 3, 2024

Hmm that's strange. I'll double check to see what's going on. Thank you!

from protoman.

umarfarooq-del avatar umarfarooq-del commented on June 3, 2024

@spluxx any updates on this ? I am facing the same issue.

got the solution?

from protoman.

benjaminwilsonvirbela avatar benjaminwilsonvirbela commented on June 3, 2024

I'm running into this issue too (v0.4.0 on Windows 10). Even an enum with a single option will cause issues:

syntax = "proto3";
package enumtest;

message MyObject {
  enum MessageType {
    MY_MESSAGE_TYPE = 0;
  }
  MessageType message_type = 1;
}

Here I encoded { messageType: 0 }:

image

I noticed if messageType is out of range, it will use the enum default (here MY_MESSAGE_TYPE) with no error. Here I encoded { messageType: 15 }:

image

Going to look into this a bit later, but at least the data can be verified in the readout window below the error message for now.

from protoman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.