Skip to content

Commit

Permalink
Remove JSON merge patch usage from output only models (#2793)
Browse files Browse the repository at this point in the history
  • Loading branch information
alzimmermsft committed May 29, 2024
1 parent 6655197 commit 83c3851
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ public ClientModel map(ObjectSchema compositeType) {
}
}

if (usages.contains(ImplementationDetails.Usage.JSON_MERGE_PATCH)
&& !usages.contains(ImplementationDetails.Usage.INPUT)) {
// Remove the usage of JSON merge patch if the model isn't used as INPUT to the service. JSON merge
// patch logic is only used for INPUT.
usages.remove(ImplementationDetails.Usage.JSON_MERGE_PATCH);
}

ClientModel.Builder builder = createModelBuilder().name(modelName)
.packageName(modelType.getPackage())
.type(modelType)
Expand Down

0 comments on commit 83c3851

Please sign in to comment.