-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Konrad Jamrozik
authored
Jul 23, 2024
1 parent
1bc9117
commit 8850294
Showing
2 changed files
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,14 +213,16 @@ private void CompareRequired(ComparisonContext<ServiceDefinition> context, Schem | |
var newRequiredNonReadOnlyPropNames = new List<string>(); | ||
foreach (string requiredPropName in Required) | ||
{ | ||
Properties.TryGetValue(requiredPropName, out Schema propSchema); | ||
priorSchema.Properties.TryGetValue(requiredPropName, out Schema priorPropSchema); | ||
bool propWasRequired = priorSchema.Required?.Contains(requiredPropName) == true; | ||
Schema propSchema = null; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mikekistler
Member
|
||
Schema priorPropSchema = null; | ||
Properties?.TryGetValue(requiredPropName, out propSchema); | ||
priorSchema?.Properties?.TryGetValue(requiredPropName, out priorPropSchema); | ||
bool propWasRequired = priorSchema?.Required?.Contains(requiredPropName) == true; | ||
// Note that property is considered read-only only if it is consistently read-only both in the old and new models. | ||
bool propIsReadOnly = propSchema?.ReadOnly == true && priorPropSchema?.ReadOnly == true; | ||
if (!propWasRequired && !propIsReadOnly) | ||
{ | ||
// Property is newly required and it is not read-only, hence it is a breaking change. | ||
// Property is newly required, and it is not read-only, hence it is a breaking change. | ||
newRequiredNonReadOnlyPropNames.Add(requiredPropName); | ||
} | ||
else | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mikekistler what should happen if a property is marked as
required
but the spec has not defined this property (line 218), or the entireProperties
block is missing (line 216)?