title: SpringBoot REST Json Request to Protobuf
body: <p>I am trying to convert a json REST request to protobuf format.</p>
  <p>Sample JSON input:</p>
  <pre><code>{
      &quot;id&quot;: 111,
      &quot;name&quot;: &quot;Anirban&quot;
  }
  </code></pre>
  <p>REST controller:</p>
  <pre><code>@PostMapping
  @ResponseStatus(HttpStatus.CREATED)
  public @ResponseBody Student handleStudent(@Valid @RequestBody Student student){
      System.out.println(&quot;Name:&quot; + student.getName());
      System.out.println(&quot;ID:&quot; + event.getId());
      // A service to convert student to protobuf and send to other service
      return student;
  }
  </code></pre>
  <p>Proto file:</p>
  <pre><code>syntax = &quot;proto3&quot;;
  package student;
  option java_multiple_files = true;
  option java_package = &quot;com.student.protobuf&quot;;
  option java_outer_classname = &quot;StudentOuter&quot;;
  
  message Student {
      int32 id = 1;
      string name = 2;
  }
  </code></pre>
  <p>Here I want to convert the received Student json request to protobuf object and send to another service. Couldn't find any proper guide for it. Any help?</p>