Skip to content

Commit d605e48

Browse files
aksOpsclaude
andcommitted
fix: add JacksonConfig, clean up McpTools unused import
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a6f482e commit d605e48

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package io.github.randomcodespace.iq.config;
2+
3+
import com.fasterxml.jackson.databind.ObjectMapper;
4+
import com.fasterxml.jackson.databind.SerializationFeature;
5+
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
6+
import org.springframework.context.annotation.Bean;
7+
import org.springframework.context.annotation.Configuration;
8+
9+
/**
10+
* Provides an ObjectMapper bean when Spring Boot's web auto-configuration
11+
* is not active (e.g., indexing profile with WebApplicationType.NONE).
12+
*/
13+
@Configuration
14+
public class JacksonConfig {
15+
16+
@Bean
17+
@ConditionalOnMissingBean(ObjectMapper.class)
18+
public ObjectMapper objectMapper() {
19+
return new ObjectMapper()
20+
.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
21+
}
22+
}

src/main/java/io/github/randomcodespace/iq/mcp/McpTools.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import io.github.randomcodespace.iq.query.QueryService;
99
import org.springframework.ai.tool.annotation.Tool;
1010
import org.springframework.ai.tool.annotation.ToolParam;
11+
import org.springframework.context.annotation.Profile;
1112
import org.springframework.stereotype.Component;
1213

1314
import java.nio.file.Path;
@@ -20,6 +21,7 @@
2021
* Tool names match the Python MCP implementation exactly.
2122
*/
2223
@Component
24+
@Profile("serving")
2325
public class McpTools {
2426

2527
private final QueryService queryService;

0 commit comments

Comments
 (0)