Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.stream.Collectors;

import io.helidon.codegen.classmodel.ClassModel;
import io.helidon.codegen.classmodel.Executable;
import io.helidon.codegen.classmodel.Method;
import io.helidon.codegen.classmodel.Parameter;
import io.helidon.common.types.AccessModifier;
Expand Down Expand Up @@ -172,23 +171,6 @@ static void addToListMethod(ClassModel.Builder classModel, TypeName type) {
classModel.addMethod(method.build());
}

/**
* Add text content to the builder as literal. The text can be multi line.
*
* @param builder executable builder
* @param text text content
*/
static void generateSafeMultiLine(Executable.Builder<?, ?> builder, String text) {
if (text.contains("\n")) {
builder.addContentLine("\"\"\"")
.increaseContentPadding()
.addContent(text.replace("\\\"", "\""))
.addContent("\"\"\"");
} else {
builder.addContentLiteral(text);
}
}

/**
* Returns {@code true} if the provided type is an MCP type and create request getter for that type,
* otherwise nothing is created and return {@code false}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

import static io.helidon.extensions.mcp.codegen.McpCodegenUtil.addToListMethod;
import static io.helidon.extensions.mcp.codegen.McpCodegenUtil.createClassName;
import static io.helidon.extensions.mcp.codegen.McpCodegenUtil.generateSafeMultiLine;
import static io.helidon.extensions.mcp.codegen.McpCodegenUtil.getDescription;
import static io.helidon.extensions.mcp.codegen.McpCodegenUtil.getElementsWithAnnotation;
import static io.helidon.extensions.mcp.codegen.McpCodegenUtil.isBoolean;
Expand Down Expand Up @@ -114,11 +113,10 @@ private void addToolOutputSchema(Method.Builder builder, TypedElementInfo elemen
}

String outputShema = textSchema.flatMap(t -> t.stringValue())
.orElseThrow(() -> new CodegenException("Cannot parse output text schema"))
.replace("\"", "\\\"");
builder.addContent("return Optional.of(");
generateSafeMultiLine(builder, outputShema);
builder.addContentLine(");");
.orElseThrow(() -> new CodegenException("Cannot parse output text schema"));
builder.addContent("return Optional.of(")
.addContentLiteral(outputShema)
.addContentLine(");");
}

private void addToolSchemaMethod(Method.Builder builder, TypedElementInfo element) {
Expand Down
4 changes: 2 additions & 2 deletions examples/calendar-application/calendar-declarative/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2025 Oracle and/or its affiliates.
Copyright (c) 2025, 2026 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
<parent>
<groupId>io.helidon.applications</groupId>
<artifactId>helidon-se</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
<relativePath/>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions examples/calendar-application/calendar/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2025 Oracle and/or its affiliates.
Copyright (c) 2025, 2026 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
<parent>
<groupId>io.helidon.applications</groupId>
<artifactId>helidon-se</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
<relativePath/>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions examples/secured-server/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2025 Oracle and/or its affiliates.
Copyright (c) 2025, 2026 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
<parent>
<groupId>io.helidon.applications</groupId>
<artifactId>helidon-se</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
<relativePath/>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions examples/weather-application/mcp-client/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2025 Oracle and/or its affiliates.
Copyright (c) 2025, 2026 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
<parent>
<groupId>io.helidon.applications</groupId>
<artifactId>helidon-se</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
<relativePath/>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions examples/weather-application/mcp-server-declarative/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2025 Oracle and/or its affiliates.
Copyright (c) 2025, 2026 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
<parent>
<groupId>io.helidon.applications</groupId>
<artifactId>helidon-se</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
<relativePath/>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions examples/weather-application/mcp-server/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2025 Oracle and/or its affiliates.
Copyright (c) 2025, 2026 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
<parent>
<groupId>io.helidon.applications</groupId>
<artifactId>helidon-se</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
<relativePath/>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

<properties>
<version.java>21</version.java>
<helidon.version>4.3.1</helidon.version>
<helidon.version>4.4.0</helidon.version>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand Down
4 changes: 4 additions & 0 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
<groupId>io.helidon.webserver</groupId>
<artifactId>helidon-webserver-cors</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.config</groupId>
<artifactId>helidon-config-metadata</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.cors</groupId>
<artifactId>helidon-cors</artifactId>
Expand Down
1 change: 1 addition & 0 deletions server/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
requires io.helidon.webserver.jsonrpc;
requires io.helidon.cors;
requires io.helidon.webserver.cors;
requires io.helidon.config.metadata;

requires static io.helidon.common.features.api;

Expand Down
Loading