Skip to content

chore: type generation fixes + improvements #1110

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

Merged
merged 13 commits into from
Jul 18, 2025
Merged

chore: type generation fixes + improvements #1110

merged 13 commits into from
Jul 18, 2025

Conversation

ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Jul 18, 2025

What does this PR do?

  • (CLI SDK) Type generation fixes:
    • Dart: Fixed import casing to snake_case, removed extends Document and hardcoded attributes, removed unnecessary imports
    • Java: Fixed indentation to 4 spaces, updated imports to java.util.Objects, fixed enum casing in strict mode as per Oracle official docs
    • Javascript: Updated optional values formatting from |null to | null
    • Kotlin: Fixed indentation to 4 spaces per Kotlinlang official docs
    • PHP: Fixed indentation to 4 spaces per PHP Fig official docs
    • Swift: Fixed indentation to 4 spaces, improved decodeIfPresent usage for optionals, added missing public to init method
    • Typescript: Fixed indentation to 4 spaces per Typescript coding guidelines
  • (Dart SDK) Fixed toConvert() method return type to Map<String, dynamic>

Test Plan

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

yes

@ChiragAgg5k ChiragAgg5k requested a review from Copilot July 18, 2025 07:15
Copy link
Contributor

@Copilot Copilot AI left a 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 focuses on fixing and improving type generation for multiple SDKs across different programming languages. The changes address formatting, indentation, typing, and code generation issues to align with official language standards and best practices.

  • Fix type generation issues across Dart, Java, Swift, TypeScript, and other language SDKs
  • Improve code formatting and indentation to match official language guidelines
  • Remove unnecessary imports and hardcoded attributes from generated types

Reviewed Changes

Copilot reviewed 5 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
templates/dart/lib/src/models/model.dart.twig Fix generic type parameter to use proper Map typing
templates/cli/lib/type-generation/languages/typescript.js.twig Fix collection iteration and template formatting
templates/cli/lib/type-generation/languages/swift.js.twig Add public visibility to init method and fix optional value decoding logic
templates/cli/lib/type-generation/languages/java.js.twig Fix enum casing, toString method formatting, and import specificity
templates/cli/lib/type-generation/languages/dart.js.twig Remove Document inheritance, fix import casing, and clean up hardcoded attributes

@abnegate abnegate merged commit 0b01a39 into master Jul 18, 2025
38 checks passed
@abnegate abnegate deleted the pla-3213 branch July 18, 2025 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants