Skip to content

Bugfix#383 remove check for existence of discriminator property in the property list - #384

Merged
PerthCharern merged 3 commits into
microsoft:masterfrom
senthilkumarmohan:bugfix#383-Remove-check-for-existence-of-discriminator-property-in-the-property-list
Feb 27, 2019
Merged

PerthCharern merged 3 commits into
microsoft:masterfrom
senthilkumarmohan:bugfix#383-Remove-check-for-existence-of-discriminator-property-in-the-property-list

Conversation

@senthilkumarmohan

Copy link
Copy Markdown
Contributor

No description provided.

@senthilkumarmohan

Senthil (senthilkumarmohan) commented Feb 18, 2019 •

Copy link
Copy Markdown
Contributor Author

#383 is due to a validation rule added against discriminator property in anyOf/oneOf lists. I have removed the check to validate if the discriminator is in the schema property list, as this check is not a MUST as per the spec. Validation against the required field list is still in place. Please can you review? ref #376.

@PerthCharern

PerthCharern commented Feb 21, 2019 •

Copy link
Copy Markdown
Contributor
    }

Darrel (@darrelmiller) Senthil (@senthilkumarmohan)

This is a bit tricky. The spec says this "The expectation now is that a property with name {discriminator.propertyName} MUST be present in the response payload".

Should we interpret "MUST be present in the response payload" to mean "MUST be a required field"? There seems to be a nuanced difference here, whether intentionally or not. The original sentence in the spec talks about the response payload only and doesn't only say anything about the property or the field itself. (Compare this with another less ambiguous wording "As such, the discriminator field MUST be a required field.")

I suggest we remove this check altogether.
#Closed


Refers to: src/Microsoft.OpenApi/Validations/Rules/OpenApiSchemaRules.cs:139 in fcd74c4. [](commit_id = fcd74c4, deletion_comment = False)

@PerthCharern

Copy link
Copy Markdown
Contributor
    }

Which means removing line 83-119 above too.


In reply to: 466162203 [](ancestors = 466162203)


Refers to: src/Microsoft.OpenApi/Validations/Rules/OpenApiSchemaRules.cs:139 in fcd74c4. [](commit_id = fcd74c4, deletion_comment = False)

@PerthCharern PerthCharern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🕐

@senthilkumarmohan

Copy link
Copy Markdown
Contributor Author

I agree, will update the PR with suggested changes.

@senthilkumarmohan

Copy link
Copy Markdown
Contributor Author

Hi PerthCharern, I have updated the PR as suggested. Please can you review?

@PerthCharern PerthCharern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

@PerthCharern

Copy link
Copy Markdown
Contributor

Thanks for your continuous contribution Senthil (@senthilkumarmohan)!

@PerthCharern
PerthCharern merged commit d169527 into microsoft:master Feb 27, 2019
@darrelmiller Darrel (darrelmiller) added this to the 1.1.3 milestone Apr 10, 2019
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.

3 participants