Skip to content

Bugfix#344 report error when one of schema doesnt have the discriminator property - #346

Merged
PerthCharern merged 8 commits into
microsoft:masterfrom
senthilkumarmohan:bugfix#344-Report-error-when-OneOf-schema-doesnt-have-the-discriminator-property
Nov 15, 2018
Merged

PerthCharern merged 8 commits into
microsoft:masterfrom
senthilkumarmohan:bugfix#344-Report-error-when-OneOf-schema-doesnt-have-the-discriminator-property

Conversation

@senthilkumarmohan

Copy link
Copy Markdown
Contributor

No description provided.

@PerthCharern

PerthCharern commented Nov 15, 2018 •

Copy link
Copy Markdown
Contributor

I don't think we need to add this validation in the reference resolver itself. In general, we try to avoid adding a validation into the reader and resolver unless we have to (e.g. YAML malformatting can't really be validated anywhere else).

This seems like it would fit better in the Validations Rules

https://github.com/Microsoft/OpenAPI.NET/tree/master/src/Microsoft.OpenApi/Validations/Rules

This rule belongs to OpenApiSchemaRules. #Closed

@senthilkumarmohan

Senthil (senthilkumarmohan) commented Nov 15, 2018 •

Copy link
Copy Markdown
Contributor Author

Okay, I will move the validation into OpenApiSchemaRules. Thanks. #Closed

@PerthCharern

PerthCharern commented Nov 15, 2018 •

Copy link
Copy Markdown
Contributor

Thanks for adding the tests to the reader. Could you help move the tests to OpenApiSchemaValidationTests.cs? Also, the tests should be adjusted to simply read the Schema object instead of the real document. #Closed

@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.

🕐

…he-discriminator-property' of https://github.com/senthilkumarmohan/OpenAPI.NET into bugfix#344-Report-error-when-OneOf-schema-doesnt-have-the-discriminator-property
@senthilkumarmohan

Senthil (senthilkumarmohan) commented Nov 15, 2018 •

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I have moved test cases to OpenApiSchemaValidationTests (with changes) and updated code as per the comments. #Closed

@PerthCharern

PerthCharern commented Nov 15, 2018 •

Copy link
Copy Markdown
Contributor

Thank you for making this change. I have left a few minor comments. Once you have fixed that and merged in the latest master, we should be good to go :)

Edit: Looks like merge is not needed given no conflicts. Github wasn't updating correctly for me.

@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:

@senthilkumarmohan

Copy link
Copy Markdown
Contributor Author

I have updated the resource keys and reverted changes to OpenApiDiscriminatorTests. Thanks again. 👍

@PerthCharern

Copy link
Copy Markdown
Contributor

This looks good now. I'll check it in.

Thanks a lot for your contribution :)

@PerthCharern
PerthCharern merged commit 26a2ef1 into microsoft:master Nov 15, 2018
@senthilkumarmohan

Copy link
Copy Markdown
Contributor Author

Thankyou very much

@senthilkumarmohan
Senthil (senthilkumarmohan) deleted the bugfix#344-Report-error-when-OneOf-schema-doesnt-have-the-discriminator-property branch November 15, 2018 22:18
@senthilkumarmohan
Senthil (senthilkumarmohan) restored the bugfix#344-Report-error-when-OneOf-schema-doesnt-have-the-discriminator-property branch November 24, 2018 01:12
@PerthCharern PerthCharern mentioned this pull request Dec 12, 2018
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.

2 participants