Repository navigation
docs(sdks): XML-encoded types: text-first child builders (incl. Go xmlTextFirstBuilders), C# indented output, Ruby/PHP declaration aliases, Java varargs - #7586
Open
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
… output, Ruby/PHP declaration aliases, Java varargs Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
requested review from
jkonrath-postman and
nerminamiller-postman
as code owners
October 23, 2026 17:08
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
|
🌿 Preview your docs: https://fern-preview-devin-1792775258-xml-builder-ergonomics.docs.buildwithfern.com/learn Here are the markdown pages you've updated: |
… Ptr helper Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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
The XML model types in Fern SDKs got easier-to-use serialization and builder methods across C#, TypeScript, Java, Go, Ruby, and PHP. This matters to SDK users who build XML documents such as telephony markup: their code gets shorter and reads more naturally. They can pass element text straight to a child builder (
response.say("hi"), orr.Say("hi", WithSayVoice("alice"))in Go once they opt in), get indented output in C#, and use familiar method names (asXML(),to_s(false),Body.builder("hi")). Go users also no longer have to build pointer-typed structs by hand to set attributes.Implements docs for: fix(csharp): XML (TwiML) child builders take text first; ToXml(xmlDeclaration, indent) (fern-api/fern#18418), fix(typescript): XML (TwiML) child builders accept text as a string; quotes not escaped in element text (fern-api/fern#18419), fix(java): XML (TwiML) list-attribute varargs, builder(text) for required text, typed child overloads under legacy names (fern-api/fern#18421), fix(php, ruby): XML (TwiML) asXML() alias and positional to_s(false) (fern-api/fern#18422), fix(go): opt-in xmlTextFirstBuilders for XML (TwiML) child builders (text + functional options) and Ptr[T] helper (fern-api/fern#18430)
Pages changed
I made the same edits to
fern/products/sdks/deep-dives/xml-encoded-types.mdxand its legacy copyfern/products/sdks/legacy/deep-dives/xml-encoded-types.mdx:& < >, and attribute values also escape".to_xml(false)andto_s(false)take the declaration flag positionally.asXML()is an alias fortoXml().ToXml(xmlDeclaration, indent)returns indented XML. The other overloads andToString()stay compact.Dial.Builder#number(Number)) alongsideaddNumber(Number), even when a text or attribute setter already uses that name.string | Partial<Fields>.builder(String text), and list-attribute setters get a varargs overload.xmlTextFirstBuilders. With it on, child methods take the text plusWith<Type><Attribute>functional options (Say(text, opts ...SayOption), orPause(opts ...PauseOption)when the element has no text), and the typed method moves toAddSay(*Say). Generated SDKs also get a genericPtr(v)helper whether or not the option is on.garden.plant("Fern", { sunlight: "full" })becamegarden.plant({ name: "Fern", sunlight: "full" }). The generated method takes a singlefields?: string | Partial<Fields>argument, so the old two-argument call didn't match it.fern/products/sdks/legacy/generators/go/configuration.mdx(thegenerators.ymloptions page) gets a newxmlTextFirstBuildersParamField (boolean, defaultfalse) with an example, linking to the XML deep dive. I left thesdk-config.ymlGo page alone: that schema doesn't map this option.I checked the signatures against the regenerated
seed/*/*-xml-twimlfixtures (includingseed/go-sdk/go-xml-twiml/xml-text-first-builders) and the generator source (generators/go/internal/generator/xml.go,generators/go/internal/cmd/cmd.go).pre-commit(vale) andfern checkboth pass.