Skip to content
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

[release/3.1] Handle shortened JSON file in dotnet openapi #36362

Merged
merged 3 commits into from Sep 13, 2021

Conversation

dougbu
Copy link
Member

@dougbu dougbu commented Sep 10, 2021

Addresses

#35767

Description

From #35767:

When dotnet-openapi is used to refresh a swagger.json document, if the new document is shorter than the old document, the file is not truncated to the new size leaving invalid trailing bytes that render it un-parsable, causing build errors.

Customer Impact

dotnet openapi refresh is very difficult to use (or justify using) in this scenario.

While the download numbers for Microsoft.dotnet-openapi aren't incredibly high (max. ~6500 for 5.0.6), this problem likely wasn't reported earlier only because OpenAPI documents tend to grow, not shrink. But, when customers hit this issue, they need to manually edit the extra-long file and rebuild. Not a positive experience.

Regression?

  • Yes
  • No

This has been a problem since the tool was first introduced in the run-up to v3.0.0.

Risk

  • High
  • Medium
  • Low

Just correct the FileMode and we're done.

Verification

  • Manual (required)
  • Automated (new tests added)

Packaging changes reviewed?

  • Yes
  • No
  • N/A

- #35767
- an existing JSON file must be truncated
- include regression test for #35767
- `AssertNoErrors(...)` doesn't exist here
@dougbu dougbu added Servicing-consider Shiproom approval is required for the issue area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI feature-openapi labels Sep 10, 2021
@ghost
Copy link

ghost commented Sep 10, 2021

"Hi dougbu. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge.

To learn more about how to prepare a servicing PR click here.

@dougbu
Copy link
Member Author

dougbu commented Sep 11, 2021

/ping reviewers

@dougbu dougbu merged commit da3f65a into release/3.1 Sep 13, 2021
@dougbu dougbu deleted the dougbu/json.the.shorter.35767/3.1 branch September 13, 2021 00:00
@dougbu dougbu added this to the 3.1.20 milestone Sep 15, 2021
@dougbu dougbu added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI feature-openapi Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants