Repository navigation
Fix schema conversion on swagger-core 3 - #23
Merged
Merged
Conversation
Json.mapper() changed its return type from Jackson 2 to Jackson 3 in swagger-core 3.0.0, which breaks plugin startup on Halo 2.28 with NoSuchMethodError. Use Json31.jsonSchemaAsMap() instead, which keeps the same signature in swagger-core 2.x and 3.x.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Json.mapper()call in tool schema generation withJson31.jsonSchemaAsMap(Schema), whose JVM signature is identical in swagger-core 2.x and 3.x.minimumas an Integer, matching the new conversion path.Root cause
Halo main (2.28.0-SNAPSHOT) upgrades springdoc-openapi from 3.1.0 to 3.2.1, which switches swagger-core from
io.swagger.core.v3:swagger-core-jakarta:2.2.52(Jackson 2) toio.swagger.core.v3:swagger-core:3.0.0(Jackson 3). The return type ofio.swagger.v3.core.util.Json.mapper()changes fromcom.fasterxml.jackson.databind.ObjectMappertotools.jackson.databind.ObjectMapper, so the compiled call inHaloSchemaPropertiesno longer links and the plugin fails to start with:Reproduction
HaloMcpServerwith theNoSuchMethodErrorabove.Verification
./gradlew test spotlessCheck: 173 tests pass.NoSuchMethodError; after the change, all 39 built-in tool input/output schemas are identical to those produced with swagger-core 2.2.52.STARTED, logsHalo MCP server started, andPOST /mcptools/listreturns HTTP 200 with 39 tools.Notes
Released Halo 2.27.x still uses springdoc 3.1.0 and is unaffected; the change is backward compatible with it.