Skip to content

Add a mustache based generator and java template (PR port)#27

Merged
ryukzak merged 11 commits intomainfrom
mustache-pr-port
Dec 26, 2025
Merged

Add a mustache based generator and java template (PR port)#27
ryukzak merged 11 commits intomainfrom
mustache-pr-port

Conversation

@ryukzak
Copy link
Copy Markdown
Collaborator

@ryukzak ryukzak commented Nov 19, 2025

Original PR:

Here:

@ryukzak ryukzak changed the title Add a mustache based generator (PR port) DRAFT: Add a mustache based generator (PR port) Nov 19, 2025
@ryukzak ryukzak marked this pull request as draft November 19, 2025 10:14
@ryukzak ryukzak changed the title DRAFT: Add a mustache based generator (PR port) Add a mustache based generator (PR port) Nov 19, 2025
Comment thread src/api/mustache/types.ts
saveName: string;
};

export const PRIMITIVE_TYPES = [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this list complete? is there a way to make this more central in the whole poject? might be relevant for type-schema as well, doesn't it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It is a full list of primitive types from R5/R6.

Comment thread src/api/writer-generator/mustache.ts Outdated
Comment thread src/api/mustache/generator/SchemaLoaderFacade.ts Outdated
field: T;
};

export class NameGenerator {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the whole NameGenerator might be pulled up and become more like a central pillar for the whole project, doesn't it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. For me, it will be much simpler just to define a language-specific function like tsModuleName and tsModuleFileName in the TS generator than to provide a configurable class for all of them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From our perspective, we wouldn’t expect to write any code to configure or use the generator. The key distinction for us is whether setup requires anything beyond simple syntax highlighting. While we’re not the only company and expectations may differ elsewhere, it’s likely that many organizations share this view. Requiring users to work with code or more complex configuration could make the setup feel less accessible for a broader audience.
Of course, it’s ultimately your decision — we’re just providing our input.

Comment thread src/utils/types.ts
Comment thread examples/mustache/java/config.json
@ryukzak ryukzak force-pushed the mustache-pr-port branch 4 times, most recently from 0720e64 to 17d0ac9 Compare November 21, 2025 16:40
@ryukzak ryukzak force-pushed the mustache-pr-port branch 4 times, most recently from 2c302b0 to 89f23a1 Compare December 24, 2025 12:00
@ryukzak ryukzak changed the base branch from main to actualize-documentation December 24, 2025 12:05
JulianStitz and others added 9 commits December 25, 2025 13:57
…ooks, debugging options, and schema-driven rendering configurations.

Provide example mustache templates to generate basic java types.

Ensure `ListElementInformationMixin` compliance in ListElementInformationMixinProvider.

Add utility rendering support in Mustache generator and implement `HttpClient` template for Java.

Refactor Mustache generator to unify resource and complex type view models, enhance template support, and eliminate unused `titleCase`.

Refactor Mustache generator to support parent-child relationships for complex types and resources. Enhance schema handling with URI-based references, add child type support to ViewModel generation, and update templates accordingly.

Add `@JsonTypeName` for improved polymorphic support in nested type templates

Add filtering support to Mustache generator with `FilterType`, enabling whitelists/blacklists for resources and complex types.

Refactor Mustache templates to unify resource and complex type handling by introducing `inner_resource_or_complex_type`. Update config.json, enhance polymorphic support, and add builder pattern support.

Enhance builder pattern in Mustache templates by introducing `ReentrantLock` for thread safety, refining `ArrayList` initialization, and adding default constructors to builders and resource classes. Update type-handling annotations and improve polymorphic support.

Introduce advanced builder pattern and feature support in Mustache templates. Add hashCode/equals, optional fields, wither methods, and improved polymorphic handling. Enhance ViewModel generation with detailed field/property flags and support for child/parent relationships. Update Maven config for spotless plugin and test dependencies. Add comprehensive `ResourceTest`.

Refactor Mustache Java templates to improve type handling and introduce date/time getter support. Update `config.json` mappings and streamline field getter logic using reusable templates.

Enhance Mustache Java templates with stricter `JsonAutoDetect` visibility for serialization control, refine `List.copyOf` logic for optional arrays, and update `ResourceTest` to include nested input serialization.

Refactor Mustache Java templates to enhance builder methods with improved support for array handling and input validation. Update imports for `Arrays` and adjust `ResourceTest` to refine task input serialization.

Enhance Mustache Java templates with improved support for `builder` feature. Refactor `config.json` and templates for `wither` integration. Update `ResourceTest` imports and task input handling. Refine Maven configuration to include `maven-source-plugin`. Optimize ViewModel generation with `NamedViewModel` ownership and streamlined primitive handling.

Refactor Mustache Java templates to replace `builder()` with `toBuilder()` in `wither` methods for consistency and improved reusability.

Update Mustache Java templates to enhance `toBuilder()` generation with conditional handling for child elements.

Update Mustache Java templates to add configurable `ResourceTest` generation and improve `type` handling in `config.json`.

Refactor Mustache Java templates to define `ResourceName` constants in resource classes, streamline `resourceClass` handling in `resource_names.mustache`, and update `config.json` paths for improved resource organization.

Enhance Mustache Java templates to add reusable extension filtering methods and integrate them into relevant resource and complex type templates.

Refactor Mustache Java templates to streamline `builder` handling by removing `wither` methods, introducing `final` modifiers for `toBuilder()` methods, and updating `config.json`. Enhance `ResourceTest` to include extension handling and additional validation.

Refactor Mustache Java templates to improve builder method generation by introducing reusable element handling for primitives and adjusting `config.json`. Update `ResourceTest` with new JSON serialization and extension handling. Remove outdated templates and refine field getter logic.

Update `ResourceTest` to refine description handling, add assertion for description equality, and adjust import order.

Refactor Mustache Java templates to enhance builder methods with support for primitive array elements, improve field getter handling, and streamline serialization logic.

Refactor Mustache Java templates and `config.json` to introduce `Primitive` type support, enhancing builder handling, serialization, and array element processing. Update `ResourceTest` to align with new primitive behaviors and add null safety checks for extension methods.

Refactor Mustache Java templates and `config.json` to introduce `Utils` class, adding equality methods for `OffsetDateTime` and lists, enhancing serialization and hash code handling. Update `ResourceTest` for `LocalDateTime` support and improve JSON serialization. Add `jackson-datatype-jsr310` dependency in `pom.xml`.

Enhance Mustache Java templates to add `CodeableConcept` behavior with `findFirstCodingBySystem` and `findCodingsBySystem` methods, refine `toBuilder()` handling, and integrate reusable behavior for complex types.

Make `findFirstCodingBySystem`, `findCodingsBySystem`, `findFirstExtensionByURL`, and `findExtensionsByURL` methods final in Mustache Java templates for improved immutability.

Add `toString` support to Mustache Java templates by updating `config.json` and integrating reusable `ToStringHelper` utility in `utils.mustache`. Include feature usage in relevant templates.

Add `toString` implementation to Mustache Java templates using `ToStringHelper`. Update `ResourceTest` with additional `toString` assertions and refine `utils.mustache` helper methods.

Extend `toString` template in Mustache Java to include primitive fields.

Configure Eclipse-based formatter for Mustache Java templates and update spotless plugin in `pom.xml`. Refactor templates to enhance null-safety annotations and streamline field declaration style.

Add reference handling in Mustache Java templates and `config.json`. Enhance `ResourceTest` with additional assertions and update `ResourceName` with utility methods for improved resource referencing.

Refactor `toString` implementation in Mustache Java templates to use `Collectors.joining`, improving code readability and reducing iteration logic.

Remove Eclipse-based formatter configuration and switch to Google Java Format in `pom.xml`. Update templates for streamlined annotation usage and add `toReference` method for resource references.

Refactor Mustache Java templates to remove redundant `final` modifiers, enhance clarity in private methods, and simplify `toString` implementation for improved readability.

Add dependency handling in Mustache Java templates and `config.json`. Update `ViewModelFactory` to collect and process resource and complex type dependencies.

Refactor Mustache Java templates to organize into `model` directory structure. Update `config.json` paths and add separate `pom.xml` files for `model` and `client-spring` modules. Simplify `sdk-parent` configuration with module-based dependency management.

Remove `client-spring` module and its `pom.xml` from Mustache Java templates. Update parent `pom.xml` to reflect module removal.
Base automatically changed from actualize-documentation to main December 25, 2025 13:55
@ryukzak ryukzak changed the title Add a mustache based generator (PR port) Add a mustache based generator and java template (PR port) Dec 25, 2025
@ryukzak ryukzak marked this pull request as ready for review December 25, 2025 16:01
@ryukzak ryukzak merged commit e1fe37c into main Dec 26, 2025
16 checks passed
@ryukzak ryukzak deleted the mustache-pr-port branch December 26, 2025 08:53
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