drowzy / protobuf_generate

Protobuf code generation as a mix task
MIT License
10 stars 3 forks source link

Generated output is missing Stubs (Routeguide.RouteGuide.Stub) blocking local test cases #3

Closed AleksandarFilipov closed 6 months ago

AleksandarFilipov commented 6 months ago

Your great work with "Transcoding HTTP/JSON to gRPC" led me to this repository.

It works excellent with the exception that all module test fails du to missing Stub functions. At the end of each generated file i would assume the following should be present:

defmodule Routeguide.RouteGuide.Stub do
  @moduledoc false
  use GRPC.Stub, service: Routeguide.RouteGuide.Service
end

Hint: Adding this manually fixes the problem.

AleksandarFilipov commented 6 months ago

That's was crazy quick, can confirm that it works great! 👍

I do get this warning, but it's fully operational!

warning: assign @module_doc? not available in EEx template. Please ensure all assigns are given as options. Available assigns: [:module, :service_name, :methods, :descriptor_fun_body, :version]
  (eex 1.15.7) lib/eex/engine.ex:140: EEx.Engine.fetch_assign!/2
  (stdlib 4.3.1.2) erl_eval.erl:744: :erl_eval.do_apply/7
  (stdlib 4.3.1.2) erl_eval.erl:323: :erl_eval.expr/6
  (stdlib 4.3.1.2) erl_eval.erl:492: :erl_eval.expr/6
  (stdlib 4.3.1.2) erl_eval.erl:136: :erl_eval.exprs/6
  (elixir 1.15.7) src/elixir.erl:375: :elixir.eval_forms/4