-
Notifications
You must be signed in to change notification settings - Fork 190
fix: dotnet template issues #1205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe DotNet language generator now uses toPascalCase for constructing public-facing identifiers, replacing previous ucfirst usage for types, property names, and enum names, including handling for array sub-schemas. Property name generation applies toPascalCase then strips leading '$' characters. Keyword comparisons now use PascalCased names. In the .NET model template, property types and constructor parameter types are rendered with the raw filter. These changes adjust identifier casing and how type expressions are emitted in generated models. Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/SDK/Language/DotNet.php (1)
498-506
: Trim only leading '$' with ltrim
Replacestr_replace('$', '', $name)
withltrim($name, '$')
to preserve any internal '$' characters and future-proof property naming.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/SDK/Language/DotNet.php
(2 hunks)templates/dotnet/Package/Models/Model.cs.twig
(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/SDK/Language/DotNet.php (1)
src/SDK/Language.php (1)
toPascalCase
(96-99)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
- GitHub Check: build (8.3, AppleSwift56)
- GitHub Check: build (8.3, Ruby31)
- GitHub Check: build (8.3, Swift56)
- GitHub Check: build (8.3, Python312)
- GitHub Check: build (8.3, Ruby30)
- GitHub Check: build (8.3, Python311)
- GitHub Check: build (8.3, Ruby27)
- GitHub Check: build (8.3, Python39)
- GitHub Check: build (8.3, Python310)
- GitHub Check: build (8.3, Python313)
- GitHub Check: build (8.3, KotlinJava17)
- GitHub Check: build (8.3, KotlinJava8)
- GitHub Check: build (8.3, KotlinJava11)
- GitHub Check: build (8.3, Go118)
- GitHub Check: build (8.3, FlutterStable)
- GitHub Check: build (8.3, CLINode18)
- GitHub Check: build (8.3, Android14Java17)
- GitHub Check: build (8.3, Android5Java17)
🔇 Additional comments (3)
templates/dotnet/Package/Models/Model.cs.twig (2)
24-24
: Consistent with property type rendering.The raw filter is correctly applied to constructor parameter types, matching the approach used for property declarations at line 15.
15-15
: Verify necessity and safety of raw filterRaw bypasses Twig auto-escaping so generic types (e.g.,
List<SubSchema>
) render correctly; confirmsub_schema()
only emits trusted, internally-generated type names to avoid injection risk.src/SDK/Language/DotNet.php (1)
481-481
: Breaking change: .NET array sub-schema types now use full PascalCase.
This replacesucfirst
withtoPascalCase
, altering generated type names (e.g.,user_settings
→UserSettings
). Confirm this is intentional and ensure existing SDK consumers are updated for the renamed types.
Summary by CodeRabbit
Bug Fixes
Refactor