-
Notifications
You must be signed in to change notification settings - Fork 191
Add type generation support for geometric types (point, linestring, polygon) #1258
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
…olygon) This commit adds support for generating types for geometric attributes (POINT, LINESTRING, POLYGON) across all supported languages in the CLI type generation feature. Type mappings: - TypeScript/JavaScript: Array<number>, Array<Array<number>>, Array<Array<Array<number>>> - C#/Dart/Java/Kotlin: List<double>/List<List<double>>/List<List<List<double>>> - PHP: array (for all geometric types) - Swift: [Double], [[Double]], [[[Double]]] Changes include: - Added POINT, LINESTRING, POLYGON to AttributeType enum - Implemented type mapping logic for all language generators
WalkthroughThis PR adds three geometry attribute types to the AttributeType enumeration: POINT, LINESTRING, POLYGON. It updates type-generation templates for C#, Dart, Java, JavaScript, Kotlin, PHP, Swift, and TypeScript to map these types to nested numeric arrays/lists (increasing nesting depth from POINT → LINESTRING → POLYGON). It updates two template package.json files (react-native and web) to bump devDependency "playwright" from 1.15.0 to 1.56.1. example.php now introduces a $branch variable and fetches the Swagger spec using the branch path. tests/WebChromiumTest.php updates Playwright Docker image tags to v1.56.1-jammy. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Areas needing attention:
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ 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). (19)
🔇 Additional comments (2)
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.
Pull Request Overview
This PR adds support for generating types for geometric database attributes (POINT, LINESTRING, POLYGON) across all supported programming languages in the CLI type generation feature. The changes enable developers to work with spatial/geographic data types in their generated type definitions.
Key changes:
- Extended the
AttributeTypeenum with three new geometric types - Implemented appropriate type mappings for all eight supported language generators
- Ensured consistent representation of nested array structures for each geometric type
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| templates/cli/lib/type-generation/attribute.js.twig | Added POINT, LINESTRING, and POLYGON constants to the AttributeType enum |
| templates/cli/lib/type-generation/languages/typescript.js.twig | Added type mappings using Array syntax for geometric types |
| templates/cli/lib/type-generation/languages/javascript.js.twig | Added type mappings using number[] JSDoc syntax for geometric types |
| templates/cli/lib/type-generation/languages/csharp.js.twig | Added type mappings using List for geometric types |
| templates/cli/lib/type-generation/languages/dart.js.twig | Added type mappings using List for geometric types |
| templates/cli/lib/type-generation/languages/java.js.twig | Added type mappings using List for geometric types |
| templates/cli/lib/type-generation/languages/kotlin.js.twig | Added type mappings using List for geometric types |
| templates/cli/lib/type-generation/languages/php.js.twig | Added type mappings using array for all geometric types |
| templates/cli/lib/type-generation/languages/swift.js.twig | Added type mappings using [Double] syntax for geometric types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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: 1
♻️ Duplicate comments (1)
templates/react-native/package.json.twig (1)
29-29: Same playwright version concern as web template.This change has the same issues noted in templates/web/package.json.twig line 29: the playwright version bump appears unrelated to the PR's geometric type objectives and should be verified for validity and security.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
templates/react-native/package.json.twig(1 hunks)templates/web/package.json.twig(1 hunks)
⏰ 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). (19)
- GitHub Check: build (8.3, Python39)
- GitHub Check: build (8.3, PHP83)
- GitHub Check: build (8.3, Python310)
- GitHub Check: build (8.3, Node18)
- GitHub Check: build (8.3, KotlinJava17)
- GitHub Check: build (8.3, KotlinJava11)
- GitHub Check: build (8.3, Node16)
- GitHub Check: build (8.3, KotlinJava8)
- GitHub Check: build (8.3, DotNet90)
- GitHub Check: build (8.3, DotNet80)
- GitHub Check: build (8.3, Android5Java17)
- GitHub Check: build (8.3, FlutterBeta)
- GitHub Check: build (8.3, Android14Java17)
- GitHub Check: build (8.3, FlutterStable)
- GitHub Check: kotlin (server)
- GitHub Check: swift (server)
- GitHub Check: flutter (client)
- GitHub Check: android (client)
- GitHub Check: apple (client)
0bf0293 to
734f44a
Compare
Summary
This PR adds support for generating types for geometric attributes (POINT, LINESTRING, POLYGON) across all supported languages in the CLI type generation feature.
Changes
POINT,LINESTRING, andPOLYGONto theAttributeTypeenum inattribute.js.twigArray<number>,Array<Array<number>>,Array<Array<Array<number>>>number[],number[][],number[][][]List<double>,List<List<double>>,List<List<List<double>>>List<double>,List<List<double>>,List<List<List<double>>>List<Double>,List<List<Double>>,List<List<List<Double>>>List<Double>,List<List<Double>>,List<List<List<Double>>>array(for all geometric types)[Double],[[Double]],[[[Double]]]Type Structure
[longitude, latitude]Test plan
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.