Package burp.mcp.util
Class McpJson
java.lang.Object
burp.mcp.util.McpJson
JSON-RPC 2.0 encoding/decoding utilities.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildError(int code, String message, Object data, Object id) static StringbuildResponse(Object result, Object id) static com.fasterxml.jackson.databind.node.ArrayNodestatic com.fasterxml.jackson.databind.node.ObjectNodestatic StringgenerateExampleJson(com.fasterxml.jackson.databind.node.ObjectNode schema) Generate an example/default JSON object from a JSON Schema properties node.static com.fasterxml.jackson.databind.ObjectMappermapper()static McpJson.JsonRpcRequestparseRequest(String json) static com.fasterxml.jackson.databind.node.ObjectNodeCreate a JSON Schema property node with type and description.static com.fasterxml.jackson.databind.node.ObjectNodeCreate a JSON Schema property node with type, description, and default value.static String
-
Constructor Details
-
McpJson
public McpJson()
-
-
Method Details
-
parseRequest
-
toJson
-
buildResponse
-
buildError
-
createObjectNode
public static com.fasterxml.jackson.databind.node.ObjectNode createObjectNode() -
createArrayNode
public static com.fasterxml.jackson.databind.node.ArrayNode createArrayNode() -
property
public static com.fasterxml.jackson.databind.node.ObjectNode property(String type, String description) Create a JSON Schema property node with type and description. Example: property("string", "The target URL") produces: {"type": "string", "description": "The target URL"} -
property
public static com.fasterxml.jackson.databind.node.ObjectNode property(String type, String description, Object defaultValue) Create a JSON Schema property node with type, description, and default value. Example: property("boolean", "Follow redirects", true) produces: {"type": "boolean", "description": "Follow redirects", "default": true} -
generateExampleJson
Generate an example/default JSON object from a JSON Schema properties node. Returns a pretty-printed JSON string with sensible defaults for each property. -
mapper
public static com.fasterxml.jackson.databind.ObjectMapper mapper()
-