Skip to content

Conversation

@jeffreyaven
Copy link
Member

Adds a toJson helper function to the stream transform template FuncMap, enabling simple XML-to-JSON passthrough transforms using:

transform:
type: golang_template_mxj_v0.1.0
body: '{{ toJson . }}'

This allows converting XML responses to JSON without writing custom field-by-field templates. The mxj library parses XML into a map structure, and toJson serializes it directly to JSON.

@general-kroll-4-life general-kroll-4-life force-pushed the claude/study-provider-spec-mQ4yM branch 2 times, most recently from f8362d4 to 2d818e0 Compare December 28, 2025 00:38
__Description__

Versioning and version-selective function inclusion for templates.

In this case the change is available to all templates with RHS semver >= `v0.2.0`.

Add toJson template function for naive XML-to-JSON transforms

Adds a toJson helper function to the stream transform template FuncMap,
enabling simple XML-to-JSON passthrough transforms using:

  transform:
    type: golang_template_mxj_v0.2.0
    body: '{{ toJson . }}'

This allows converting XML responses to JSON without writing custom
field-by-field templates. The mxj library parses XML into a map structure,
and toJson serializes it directly to JSON.
@general-kroll-4-life general-kroll-4-life force-pushed the claude/study-provider-spec-mQ4yM branch from a38d643 to 38f3bce Compare December 28, 2025 01:24
@general-kroll-4-life general-kroll-4-life merged commit 7733c19 into main Dec 28, 2025
9 checks passed
@general-kroll-4-life general-kroll-4-life deleted the claude/study-provider-spec-mQ4yM branch December 28, 2025 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants