Class NetworkCaptureOptions
Kept as a plain mutable class with public fields (rather than a record) because Spring AI
binds @Tool method parameters of this type directly from tool-call JSON; equals(Object)
and hashCode() are still overridden for structural equality since instances round-trip
through CaptureStartOptions, a record whose generated equals depends on it.
Do not switch the field annotations below to @ToolParam(required = false). That
is the usual Spring AI idiom (see CaptureService#apiStart parameters and
McpMobileInitOptions), but this class lives in shaft-capture -- a low-level runtime
module that shaft-mcp depends on, not the reverse -- and @ToolParam lives in
spring-ai-model, which shaft-capture deliberately does not depend on. Pulling that
in here would invert the module boundary just to annotate a DTO. Instead this relies on Spring
AI's JSON schema generator (victools' JacksonModule with
RESPECT_JSONPROPERTY_REQUIRED) honouring the framework-neutral
com.fasterxml.jackson.annotation.JsonProperty(required = ...) as an equivalent signal --
confirmed by decompiling spring-ai-model's JsonSchemaGenerator.
ShaftMcpApplicationTests#captureApiStartNetworkOptionsSchemaHasNoRequiredFieldsSoPartialNetworkOptionsSucceed
guards this behavior against regression (issue #3986).
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanWhether to record HTTP request bodies.booleanWhether to record HTTP response bodies.booleanWhether to capture network requests.booleanWhether to exclude asset resource types (images, fonts, stylesheets).Glob pattern for URL paths to exclude from capture.Glob pattern for URL paths to include in capture. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
enabled
public boolean enabledWhether to capture network requests. -
excludeAssets
public boolean excludeAssetsWhether to exclude asset resource types (images, fonts, stylesheets). -
excludePattern
Glob pattern for URL paths to exclude from capture. -
includePattern
Glob pattern for URL paths to include in capture. Empty string means include all (subject to other filters). -
captureResponseBodies
public boolean captureResponseBodiesWhether to record HTTP response bodies. -
captureRequestBodies
public boolean captureRequestBodiesWhether to record HTTP request bodies.
-
-
Constructor Details
-
NetworkCaptureOptions
public NetworkCaptureOptions()Creates default network capture options.
-
-
Method Details
-
equals
-
hashCode
-
toString
-