在 Manus 中运行任何 Skill
一键导入
一键导入
一键在 Manus 中运行任何 Skill
开始使用$pwd:
aot-json-serializer-context
// Generate Refitter AOT serializer contexts without regex-only type discovery
$ git log --oneline --stat
stars:399
forks:64
updated:2026年4月29日 20:44
SKILL.md
// Generate Refitter AOT serializer contexts without regex-only type discovery
{what this skill teaches agents}
Split landed work into focused commits and isolate stale automation cleanup
Decide whether a report is a docs mismatch, a real product bug, or both
Handle malformed OpenAPI schema names that collapse to empty generated C# type names, especially trailing-dot definition keys.
Run focused Refitter tests with TUnit treenode filters
Run focused Refitter tests with TUnit treenode filters
| name | aot-json-serializer-context |
| description | Generate Refitter AOT serializer contexts without regex-only type discovery |
| domain | code-generation |
| confidence | high |
| source | earned |
Use this skill when Refitter needs to emit JsonSerializerContext code for generated contracts. The old regex-only approach missed namespaces, nested types, and closed generic usages, and could emit attributes in the wrong place.
CSharpSyntaxTree.ParseText() over the generated contracts source.BaseTypeDeclarationSyntax.Outer.Inner.TypeSyntax nodes (for example Envelope<Pet>), never the open declaration (Envelope<T>).namespace {ContractsNamespace ?? Namespace}.[JsonSerializable(typeof(...))] attributes directly on the partial context class, not before the namespace declaration.Naming.InterfaceName, stripping a conventional leading I (IUsersApi -> UsersApiSerializerContext), and fall back to NamingSettings.DefaultInterfaceName if the name is blank.{ContextName}.cs file.src/Refitter.Core/JsonSerializerContextGenerator.cssrc/Refitter.Core/RefitGenerator.cssrc/Refitter.Tests/JsonSerializerContextGeneratorTests.cssrc/Refitter.Tests/Scenarios/GenerateJsonSerializerContextTests.cs[JsonSerializable].