Skip to content

json patch dto conversion#1603

Open
suarezrominajulieta wants to merge 9 commits into
masterfrom
feature/jsonPatch_DTOConvertion
Open

json patch dto conversion#1603
suarezrominajulieta wants to merge 9 commits into
masterfrom
feature/jsonPatch_DTOConvertion

Conversation

@suarezrominajulieta

Copy link
Copy Markdown
Collaborator

In this pr we fix the TO-DO on json patch dtoWritter.

@suarezrominajulieta suarezrominajulieta changed the title json patch dto convertion json patch dto conversion Jun 20, 2026
@suarezrominajulieta suarezrominajulieta marked this pull request as ready for review June 20, 2026 03:35
}

// Registers the shared JsonPatchOperation DTO and collects nested DTOs for object/array values.
private fun calculateDtoFromJsonPatch(gene: JsonPatchDocumentGene) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

replace comment with Javadoc

private fun calculateDtoFromJsonPatch(gene: JsonPatchDocumentGene) {
val dtoName = GeneToDto.JSON_PATCH_OPERATION_DTO
val dtoClass = dtoCollector.computeIfAbsent(dtoName) { DtoClass(it) }
dtoClass.addField(GeneToDto.FIELD_OP, DtoField(GeneToDto.FIELD_OP, "String"))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

replace "String" with constant value

}

private fun anyType(): String {
return if (outputFormat.isJava()) "Object" else "Any"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

replace "Object" and "Any" with constant values

}

// Renders a JSON Patch document as a List<JsonPatchOperation>, one DTO per active operation.
private fun getJsonPatchDtoCall(gene: JsonPatchDocumentGene, counters: MutableList<Int>): DtoCall {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

replace comment with Javadoc

}

// Renders a single RFC 6902 operation as a JsonPatchOperation DTO with only its relevant fields set.
private fun getJsonPatchOperationCall(operation: JsonPatchOperationGene, counters: MutableList<Int>): DtoCall {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

replace comment with Javadoc

}

// Sets the "value" field: primitives are inlined as literals, objects/arrays delegate to DTO generation.
private fun setJsonPatchValue(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

replace comment with Javadoc

Base automatically changed from feature/jsonPatch_e2e to master June 26, 2026 09:08
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