test_class.file: protoc-gen-jersey/src/test/java/com/fullcontact/rpc/jersey/CodeGeneratorTest.java
test_class.identifier: CodeGeneratorTest
test_case.body: @Test
      public void parsePathParams() throws Exception {
          assertThat(CodeGenerator
                  .parsePathParams(TestRequest.getDescriptor(), PathParser.parse("/users/{s}/{uint3}/{nt.f1}")))
                  .extracting("name")
                  .containsExactly("s", "uint3", "nt.f1");
          assertThat(CodeGenerator
                  .parsePathParams(TestRequest.getDescriptor(), PathParser.parse("/users/{s}/{uint3}/{nt.f1}")))
                  .extracting(x -> Iterables.getLast(x.getFieldDescriptor()).getName())
                  .containsExactly("s", "uint3", "f1");
      }
test_case.class_method_signature: CodeGeneratorTest.parsePathParams()
test_case.full_signature: @Test public void parsePathParams()
test_case.identifier: parsePathParams
test_case.invocations: containsExactly extracting assertThat parsePathParams getDescriptor parse containsExactly extracting assertThat parsePathParams getDescriptor parse getName getLast getFieldDescriptor
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void parsePathParams()
focal_class.file: protoc-gen-jersey/src/main/java/com/fullcontact/rpc/jersey/CodeGenerator.java
focal_class.identifier: CodeGenerator
focal_class.class_method_signature: CodeGenerator.parsePathParams(Descriptors.Descriptor inputDescriptor,
              PathParser.ParsedPath path)
focal_class.full_signature: public static ImmutableList<PathParam> parsePathParams(Descriptors.Descriptor inputDescriptor,
              PathParser.ParsedPath path)
focal_class.identifier: parsePathParams
focal_class.modifiers: public static
focal_class.parameters: (Descriptors.Descriptor inputDescriptor,
              PathParser.ParsedPath path)
focal_class.return: ImmutableList<PathParam>
focal_class.signature: ImmutableList<PathParam> parsePathParams(Descriptors.Descriptor inputDescriptor,
              PathParser.ParsedPath path)
focal_class.class_method_signature: CodeGenerator.generate(PluginProtos.CodeGeneratorRequest request)
focal_class.full_signature: public PluginProtos.CodeGeneratorResponse generate(PluginProtos.CodeGeneratorRequest request)
focal_class.identifier: generate
focal_class.modifiers: public
focal_class.parameters: (PluginProtos.CodeGeneratorRequest request)
focal_class.return: PluginProtos.CodeGeneratorResponse
focal_class.signature: PluginProtos.CodeGeneratorResponse generate(PluginProtos.CodeGeneratorRequest request)
focal_class.class_method_signature: CodeGenerator.generateResource(
              PluginProtos.CodeGeneratorResponse.Builder response,
              Map<String, Descriptors.Descriptor> descriptorTable,
              DescriptorProtos.FileDescriptorProto fileDescriptorProto,
              List<ServiceAndMethod> generate,
              boolean isProxy)
focal_class.full_signature: private void generateResource(
              PluginProtos.CodeGeneratorResponse.Builder response,
              Map<String, Descriptors.Descriptor> descriptorTable,
              DescriptorProtos.FileDescriptorProto fileDescriptorProto,
              List<ServiceAndMethod> generate,
              boolean isProxy)
focal_class.identifier: generateResource
focal_class.modifiers: private
focal_class.parameters: (
              PluginProtos.CodeGeneratorResponse.Builder response,
              Map<String, Descriptors.Descriptor> descriptorTable,
              DescriptorProtos.FileDescriptorProto fileDescriptorProto,
              List<ServiceAndMethod> generate,
              boolean isProxy)
focal_class.return: void
focal_class.signature: void generateResource(
              PluginProtos.CodeGeneratorResponse.Builder response,
              Map<String, Descriptors.Descriptor> descriptorTable,
              DescriptorProtos.FileDescriptorProto fileDescriptorProto,
              List<ServiceAndMethod> generate,
              boolean isProxy)
focal_class.class_method_signature: CodeGenerator.buildResourceSpec(
              Map<String, Descriptors.Descriptor> descriptorTable,
              DescriptorProtos.FileDescriptorProto fileDescriptorProto,
              List<ServiceAndMethod> methodSpecs,
              boolean isProxy)
focal_class.full_signature: @VisibleForTesting ResourceToGenerate buildResourceSpec(
              Map<String, Descriptors.Descriptor> descriptorTable,
              DescriptorProtos.FileDescriptorProto fileDescriptorProto,
              List<ServiceAndMethod> methodSpecs,
              boolean isProxy)
focal_class.identifier: buildResourceSpec
focal_class.modifiers: @VisibleForTesting
focal_class.parameters: (
              Map<String, Descriptors.Descriptor> descriptorTable,
              DescriptorProtos.FileDescriptorProto fileDescriptorProto,
              List<ServiceAndMethod> methodSpecs,
              boolean isProxy)
focal_class.return: ResourceToGenerate
focal_class.signature: ResourceToGenerate buildResourceSpec(
              Map<String, Descriptors.Descriptor> descriptorTable,
              DescriptorProtos.FileDescriptorProto fileDescriptorProto,
              List<ServiceAndMethod> methodSpecs,
              boolean isProxy)
focal_class.class_method_signature: CodeGenerator.parseRule(ServiceAndMethod sam,
              Descriptors.Descriptor inputDescriptor,
              Descriptors.Descriptor outputDescriptor)
focal_class.full_signature: @VisibleForTesting ImmutableList<ResourceMethodToGenerate> parseRule(ServiceAndMethod sam,
              Descriptors.Descriptor inputDescriptor,
              Descriptors.Descriptor outputDescriptor)
focal_class.identifier: parseRule
focal_class.modifiers: @VisibleForTesting
focal_class.parameters: (ServiceAndMethod sam,
              Descriptors.Descriptor inputDescriptor,
              Descriptors.Descriptor outputDescriptor)
focal_class.return: ImmutableList<ResourceMethodToGenerate>
focal_class.signature: ImmutableList<ResourceMethodToGenerate> parseRule(ServiceAndMethod sam,
              Descriptors.Descriptor inputDescriptor,
              Descriptors.Descriptor outputDescriptor)
focal_method.body: public static ImmutableList<PathParam> parsePathParams(Descriptors.Descriptor inputDescriptor,
              PathParser.ParsedPath path) {
          ImmutableList.Builder<PathParam> pathParams = ImmutableList.builder();
          path.visit(new PathParser.EmptySegmentVisitor() {
              @Override
              public void visit(PathParser.NamedVariable namedVariable) {
                  ImmutableList<Descriptors.FieldDescriptor> fieldDescriptor =
                          ProtobufDescriptorJavaUtil.fieldPath(inputDescriptor, namedVariable.getName());
  
                  if (fieldDescriptor.isEmpty()) {
                      throw new IllegalArgumentException("Couldn't find path param: " + namedVariable.getName()
                              + " in input type: " + inputDescriptor.toProto());
                  }
  
                  Descriptors.FieldDescriptor descriptor = Iterables.getLast(fieldDescriptor);
  
                  if (descriptor.isMapField() || descriptor.isRepeated()) {
                      throw new IllegalArgumentException(
                              "Cannot map path param '" + namedVariable.getName() + "' as URL mapping is not supported " +
                                      "for map or repeated field types."
                      );
                  }
  
                  pathParams.add(new PathParam(namedVariable.getName(), fieldDescriptor));
              }
          });
  
          return pathParams.build();
      }
focal_method.class_method_signature: CodeGenerator.parsePathParams(Descriptors.Descriptor inputDescriptor,
              PathParser.ParsedPath path)
focal_method.full_signature: public static ImmutableList<PathParam> parsePathParams(Descriptors.Descriptor inputDescriptor,
              PathParser.ParsedPath path)
focal_method.identifier: parsePathParams
focal_method.invocations: builder visit fieldPath getName isEmpty getName toProto getLast isMapField isRepeated getName add getName build
focal_method.modifiers: public static
focal_method.parameters: (Descriptors.Descriptor inputDescriptor,
              PathParser.ParsedPath path)
focal_method.return: ImmutableList<PathParam>
focal_method.signature: ImmutableList<PathParam> parsePathParams(Descriptors.Descriptor inputDescriptor,
              PathParser.ParsedPath path)