Devx 867 render body fix - #354
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The changes are small, consistent with existing type-mapping logic (File→java.io.File, file→Stream), and directly address codegen failures without introducing broader behavioral risk.
Pull request overview
This PR fixes code generation edge cases for RAML file types by ensuring Java and C# predicate DSLs treat file/stream properties as scalar-comparable rather than nested object predicates, and by avoiding generation of Java builder tests that can’t construct valid File values.
Changes:
- Java builder test generation now excludes
file(andarray<file>) properties from generated builder/property tests. - Java query predicate generation now treats
java.io.Fileproperties as comparison predicates. - C# query predicate generation and C# type/usings helpers now treat
Stream(the C# base type for RAMLfile) as a scalar-like type and addSystem.IOwhen needed.
File summaries
| File | Description |
|---|---|
| languages/javalang/builder-renderer/java-builder-client/src/main/kotlin/io/vrap/codegen/languages/javalang/client/builder/test/JavaBuilderTestRenderer.kt | Filters out file and file-array properties so generated builder tests don’t emit invalid File assignments. |
| languages/javalang/builder-renderer/java-builder-client/src/main/kotlin/io/vrap/codegen/languages/javalang/client/builder/predicates/JavaQueryPredicateRenderer.kt | Adds java.io.File to the scalar-comparison predicate path to avoid generating non-existent nested DSL types. |
| languages/csharp/src/main/kotlin/io/vrap/codegen/languages/csharp/predicates/CsharpQueryPredicateRenderer.kt | Treats Stream as comparison-predicate eligible so file properties don’t generate nested DSLs. |
| languages/csharp/src/main/kotlin/io/vrap/codegen/languages/csharp/extensions/CsharpVrapExtensions.kt | Ensures Stream stays as Stream (not IStream) in C# simple-name rendering. |
| languages/csharp/src/main/kotlin/io/vrap/codegen/languages/csharp/extensions/CsharpObjectTypeExtensions.kt | Adds using System.IO; when a model includes Stream (or IList<Stream>) properties. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixing codegen issue: https://github.com/commercetools/commercetools-api-reference/actions/runs/33154611214/job/98794295649