Skip to content

bugfixes #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 19, 2022
Merged

bugfixes #250

merged 7 commits into from
Oct 19, 2022

Conversation

jianyexi
Copy link
Contributor

@jianyexi jianyexi commented Oct 13, 2022

fix: don't report error when response schema changed #248
fix No difference reported for required property changed to optional #207
fix Ref model change for property, array item or map items should be a breaking change #233

@jianyexi jianyexi marked this pull request as ready for review October 13, 2022 06:19
@jianyexi jianyexi changed the title bugfix for AddedPropertyInResponse bugfixes Oct 13, 2022
@jianyexi jianyexi requested a review from mikekistler October 13, 2022 09:13
Copy link
Member

@mikekistler mikekistler left a comment

Choose a reason for hiding this comment

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

I left a few questions and comments.

It took me some time to figure out exactly what problems this PR was addresing. The referenced issues were extremely terse. I could have used a bit more context in the PR description. This is also why I asked for more focused test files.

Comment on lines 10 to 33
"/api/Parameters": {
"put": {
"tags": [ "Parameters" ],
"operationId": "Parameters_Put",
"produces": [
"text/plain"
],
"parameters": [
{
"name": "database",
"in": "body",
"required": true,
"schema": { "$ref": "#/definitions/DatabaseRenamed" }
}
],
"responses": {
"200": {
"schema":{
"$ref": "#/definitions/DatabaseRenamed"
}
}
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I think the test files should be "minimal" -- contain only what is needed to exercise the particular check being tested.

I don't think any of this is needed for the test.

Suggested change
"/api/Parameters": {
"put": {
"tags": [ "Parameters" ],
"operationId": "Parameters_Put",
"produces": [
"text/plain"
],
"parameters": [
{
"name": "database",
"in": "body",
"required": true,
"schema": { "$ref": "#/definitions/DatabaseRenamed" }
}
],
"responses": {
"200": {
"schema":{
"$ref": "#/definitions/DatabaseRenamed"
}
}
}
}
}

jianyexi and others added 3 commits October 18, 2022 12:56
…CompareTests.cs

Co-authored-by: Mike Kistler <mikekistler@microsoft.com>

// Verify a inline schema of response was changed to reference schema and a new proeprty was added.
[Fact]
public void AddedOptionalPropertyToInlineResponseSchema()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@mikekistler mikekistler left a comment

Choose a reason for hiding this comment

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

Looks good. 👍

@jianyexi jianyexi merged commit 1067c32 into main Oct 19, 2022
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