void visit(final PathItem.HttpMethod method, final Operation operation, final PathItem pathItem) {
        if (filter.accept(operation.getOperationId())) {
            final String methodName = method.name().toLowerCase();
            emitter.emit(methodName, path);

            emit("id", operation.getOperationId());
            emit("description", operation.getDescription());
            Set<String> operationLevelConsumes = new LinkedHashSet<>();
            if (operation.getRequestBody() != null && operation.getRequestBody().getContent() != null) {
                operationLevelConsumes.addAll(operation.getRequestBody().getContent().keySet());
            }
            emit("consumes", operationLevelConsumes);
            Set<String> operationLevelProduces = new LinkedHashSet<>();
            if (operation.getResponses() != null) {
                for (ApiResponse response : operation.getResponses().values()) {
                    if (response.getContent() != null) {
                        operationLevelProduces.addAll(response.getContent().keySet());
                    }
                }
                ApiResponse response = operation.getResponses().get(ApiResponses.DEFAULT);
                if (response != null && response.getContent() != null) {
                    operationLevelProduces.addAll(response.getContent().keySet());
                }
            }
            emit("produces", operationLevelProduces);

            if (ObjectHelper.isNotEmpty(operation.getParameters())) {
                operation.getParameters().forEach(this::emit);
            }
            if (ObjectHelper.isNotEmpty(pathItem.getParameters())) {
                pathItem.getParameters().forEach(this::emit);
            }
            emitOperation(operation);

            emitter.emit("to", destinationGenerator.generateDestinationFor(operation));
        }
    }
@Test
    public void shouldEmitCodeForOas3ParameterInPath() {
        final Builder method = MethodSpec.methodBuilder("configure");
        final MethodBodySourceCodeEmitter emitter = new MethodBodySourceCodeEmitter(method);
        final OperationVisitor<?> visitor
                = new OperationVisitor<>(
                        emitter, new OperationFilter(), "/path/{param}", new DefaultDestinationGenerator(), null);

        final Paths paths = new Paths();
        final PathItem path = new PathItem();
        paths.addPathItem("/path/{param}", path);

        final Operation operation = new Operation();
        final Parameter parameter = new Parameter();
        parameter.setName("param");
        parameter.setIn("path");
        path.addParametersItem(parameter);

        visitor.visit(PathItem.HttpMethod.GET, operation, path);

        assertThat(method.build().toString()).isEqualTo("void configure() {\n"
                                                        + "    get(\"/path/{param}\")\n"
                                                        + "      .param()\n"
                                                        + "        .name(\"param\")\n"
                                                        + "        .type(org.apache.camel.model.rest.RestParamType.path)\n"
                                                        + "        .required(true)\n"
                                                        + "      .endParam()\n"
                                                        + "      .to(\"direct:rest1\")\n"
                                                        + "    }\n");
    }