Skip to content

Commit 83c3851

Browse files
authored
Remove JSON merge patch usage from output only models (#2793)
1 parent 6655197 commit 83c3851

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

javagen/src/main/java/com/azure/autorest/mapper/ModelMapper.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ public ClientModel map(ObjectSchema compositeType) {
7373
}
7474
}
7575

76+
if (usages.contains(ImplementationDetails.Usage.JSON_MERGE_PATCH)
77+
&& !usages.contains(ImplementationDetails.Usage.INPUT)) {
78+
// Remove the usage of JSON merge patch if the model isn't used as INPUT to the service. JSON merge
79+
// patch logic is only used for INPUT.
80+
usages.remove(ImplementationDetails.Usage.JSON_MERGE_PATCH);
81+
}
82+
7683
ClientModel.Builder builder = createModelBuilder().name(modelName)
7784
.packageName(modelType.getPackage())
7885
.type(modelType)

0 commit comments

Comments
 (0)