Skip to content

Enabling support for additionalProperties#1449

Merged
arcuri82 merged 11 commits intomasterfrom
phg/supportAddProps
Feb 15, 2026
Merged

Enabling support for additionalProperties#1449
arcuri82 merged 11 commits intomasterfrom
phg/supportAddProps

Conversation

@Pgarrett
Copy link
Collaborator

@Pgarrett Pgarrett commented Feb 12, 2026

Adding support for additionalProperties containing objects. If the target DTO contains additionalProperties, then the generated DTO will contain code like:

@JsonIgnore
private val additionalProperties: MutableMap<String, ChildSchema> = mutableMapOf()

@JsonAnyGetter
fun getAdditionalProperties(): MutableMap<String, ChildSchema> {
    return additionalProperties
}

@JsonAnySetter
fun addAdditionalProperty(name: String, value: ChildSchema) {
    additionalProperties[name] = value
}

Where ChildSchema is the nested object represented in the additionalProperties.

@Pgarrett Pgarrett changed the title Phg/support add props Enabling support for additionalProperties Feb 12, 2026
@Pgarrett Pgarrett marked this pull request as ready for review February 12, 2026 17:58
@Pgarrett Pgarrett requested a review from arcuri82 February 12, 2026 17:59
path.toFile().appendText(testFileContent)
}

fun capitalizeFirstChar(word: String) : String {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this kind of function should be in a utility class, as can be re-used throughout the codebase. for example, before writing something like this, should check what available in org.evomaster.core.utils... there, you can find StringUtils.capitalization() :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Close enough! The capitalization function lowercases the rest of the word, I just want the first char to be capitalized. I'll move the function to StringUtils though.

@Pgarrett Pgarrett requested a review from arcuri82 February 15, 2026 16:49
@arcuri82 arcuri82 merged commit 2f32ac0 into master Feb 15, 2026
13 checks passed
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