- 
                Notifications
    
You must be signed in to change notification settings  - Fork 100
 
Group decoder support (inefficient) #84
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
Conversation
| 
           Can you provide an example proto that would illustrate a group? I'd like to test through this.  | 
    
| 
           Your code only adds support for decoding an encoded group, does that mean you are expecting support for being able to encode groups as well? I'd rather not merge this in until we had full compiler, encode, and decode support.  | 
    
| 
           I don't need to serialize groups, so I probably won't do it. The compiler (proto to ruby by using rproto if I'm understanding correctly) supports groups well.  | 
    
| 
           Sure, but I'm saying it doesn't make sense for this library to only support decoding of groups, we should add encoding as well before supporting either side. I wrote the rprotoc compiler as well and we definitely don't support groups at this point (though I'm not opposed to it of course).  | 
    
| 
           well, I'm using the rprotoc compiler you created, and it works very well with groups. Having said that, I understand that without the serialization routines, this patch is funny.  | 
    
| 
           Fascinating the compiler is working with it. Can you post the proto and compiled ruby for a group? I'd like to see how the descriptor API is providing the groups. It may be simply that we add a DSL method to the class to indicate that the type is a Group. This would allow us to encode with the group header for that type. I don't think you should close, but perhaps we can work together to add the encoding step.  | 
    
| 
           Example of a protobuf with groups: Generated ruby:   class PurchaseInfoProto
    class BillingInstruments
      class BillingInstrument
        optional ::Protobuf::Field::StringField, :id, 5
        optional ::Protobuf::Field::StringField, :name, 6
        optional ::Protobuf::Field::BoolField, :is_invalid, 7
        optional ::Protobuf::Field::Int32Field, :instrument_type, 11
        optional ::Protobuf::Field::Int32Field, :instrument_status, 14
      end
      repeated ::GooglePlay::PurchaseInfoProto::BillingInstruments::BillingInstrument, :billinginstrument, 4
      optional ::Protobuf::Field::StringField, :default_billing_instrument_id, 8
    end
    optional ::Protobuf::Field::StringField, :transaction_id, 1
    optional ::GooglePlay::PurchaseCartInfoProto, :cart_info, 2
    optional ::GooglePlay::PurchaseInfoProto::BillingInstruments, :billinginstruments, 3
    repeated ::Protobuf::Field::Int32Field, :error_input_fields, 9
    optional ::Protobuf::Field::StringField, :refund_policy, 10
    optional ::Protobuf::Field::BoolField, :user_can_add_gdd, 12
    repeated ::Protobuf::Field::Int32Field, :eligible_instrument_types, 13
    optional ::Protobuf::Field::StringField, :order_id, 15
  endIf you never intended to support them, congrats!!!! It means that the abstractions you chose are really working well :)  | 
    
| 
           Hahaha, fortunately those abstractoins are simply the   | 
    
| 
           Okay, even though it's probably trivial to do the serialization routine, I'm not going to do it at the moment, I have an android market to crawl, and I'm under tight deadlines. I'll come back to you if I find the time to do it :) Thanks for the gem btw 👍  | 
    
| 
           Oh you are very welcome. I'll take a stab at the encoding if I get a spare hour in the next few days. Thanks again for the contributions.  | 
    
| 
           Found where I added compiler support for group fields. Honestly don't remember adding it, but there it is. The only thing to do then is write an option on the end of the field definition  👍  | 
    
| 
           I'm going to close this for now. We may add this in the future but I'm not ready to commit to it (as evidence that the PR has been open for 10 months).  | 
    
No description provided.