Problem
When an OpenAPI spec has both tags and x-fern-sdk-group-name extensions that resolve to the same PascalCase name, AutoSDK adds 2 suffixes to sub-client class names to resolve the "collision" — even though the original tag ends up with zero assigned methods and should be filtered out.
Example: Vectara SDK
The Vectara spec has:
- OpenAPI tag:
"Corpora"
x-fern-sdk-group-name: corpora on all operations tagged with "Corpora"
With UseExtensionNaming=true (default), AutoSDK:
- Collects all OpenAPI tags →
["Corpora", "Encoders", "Rerankers", ...]
- Scans
x-fern-sdk-group-name values → adds ["corpora", "encoders", "rerankers", ...] as ad-hoc tags
- Both
"Corpora" and "corpora" resolve to PascalCase Corpora → collision detected → suffix 2 added
- Operations are reassigned from tag
"Corpora" to group "corpora" → tag "Corpora" ends up empty
- Empty tags are filtered out — but the collision was already resolved with the
2 suffix
Result: Corpora2Client, Encoders2Client, Rerankers2Client, Agents2Client, etc.
Expected Behavior
AutoSDK should resolve naming collisions after filtering out empty tags (tags that lost all their operations to x-fern-sdk-group-name reassignment). Since the original tag "Corpora" has zero methods after reassignment, it should be removed before collision detection runs, and the group "corpora" should produce a clean CorporaClient.
Current Workaround
Strip x-fern-sdk-group-name and x-fern-sdk-method-name from the spec in generate.sh:
python3 -c "
import re, sys
with open('openapi.yaml') as f:
lines = f.readlines()
out = []
for line in lines:
stripped = line.strip()
if stripped.startswith('x-fern-sdk-group-name:') or stripped.startswith('x-fern-sdk-method-name:'):
continue
out.append(line)
with open('openapi.yaml', 'w') as f:
f.writelines(out)
"
Note: This is fragile — it doesn't handle YAML list-style values like:
x-fern-sdk-group-name:
- auth
A proper YAML parser (PyYAML) is needed for robust stripping.
Affected SDKs
Any SDK whose spec uses Fern-generated x-fern-sdk-group-name values that match the OpenAPI tag names in PascalCase. Currently known: Vectara.
Suggested Fix
In Data.cs, move the collision resolution step to after the empty-tag filtering step. The flow should be:
- Collect tags + ad-hoc groups
- Reassign operations based on
x-fern-sdk-group-name
- Filter out empty tags (tags with zero assigned methods)
- Then resolve PascalCase naming collisions among remaining tags/groups
Problem
When an OpenAPI spec has both tags and
x-fern-sdk-group-nameextensions that resolve to the same PascalCase name, AutoSDK adds2suffixes to sub-client class names to resolve the "collision" — even though the original tag ends up with zero assigned methods and should be filtered out.Example: Vectara SDK
The Vectara spec has:
"Corpora"x-fern-sdk-group-name: corporaon all operations tagged with"Corpora"With
UseExtensionNaming=true(default), AutoSDK:["Corpora", "Encoders", "Rerankers", ...]x-fern-sdk-group-namevalues → adds["corpora", "encoders", "rerankers", ...]as ad-hoc tags"Corpora"and"corpora"resolve to PascalCaseCorpora→ collision detected → suffix2added"Corpora"to group"corpora"→ tag"Corpora"ends up empty2suffixResult:
Corpora2Client,Encoders2Client,Rerankers2Client,Agents2Client, etc.Expected Behavior
AutoSDK should resolve naming collisions after filtering out empty tags (tags that lost all their operations to
x-fern-sdk-group-namereassignment). Since the original tag"Corpora"has zero methods after reassignment, it should be removed before collision detection runs, and the group"corpora"should produce a cleanCorporaClient.Current Workaround
Strip
x-fern-sdk-group-nameandx-fern-sdk-method-namefrom the spec ingenerate.sh:Note: This is fragile — it doesn't handle YAML list-style values like:
A proper YAML parser (PyYAML) is needed for robust stripping.
Affected SDKs
Any SDK whose spec uses Fern-generated
x-fern-sdk-group-namevalues that match the OpenAPI tag names in PascalCase. Currently known: Vectara.Suggested Fix
In
Data.cs, move the collision resolution step to after the empty-tag filtering step. The flow should be:x-fern-sdk-group-name