json patch dto conversion#1603
Conversation
| } | ||
|
|
||
| // Registers the shared JsonPatchOperation DTO and collects nested DTOs for object/array values. | ||
| private fun calculateDtoFromJsonPatch(gene: JsonPatchDocumentGene) { |
There was a problem hiding this comment.
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")) |
There was a problem hiding this comment.
replace "String" with constant value
| } | ||
|
|
||
| private fun anyType(): String { | ||
| return if (outputFormat.isJava()) "Object" else "Any" |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
replace comment with Javadoc
| } | ||
|
|
||
| // Sets the "value" field: primitives are inlined as literals, objects/arrays delegate to DTO generation. | ||
| private fun setJsonPatchValue( |
There was a problem hiding this comment.
replace comment with Javadoc
|
JsonPatchObjectValueDtoEM: |
|
JsonPatchStringValueDtoEM: |
|
I created the two applications and tests, but not with POST, since the POST OpenAPI, lacking a body, would not have the schema to create the resource of a non-primitive object. i left this comment for our meeting, ty! |
|
Please edit your comments to write them in English. |
In this pr we fix the TO-DO on json patch dtoWritter.