Skip to content

Optional EOL for XmlComments (#2947) #3255

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 2 commits into from
Feb 12, 2025
Merged

Optional EOL for XmlComments (#2947) #3255

merged 2 commits into from
Feb 12, 2025

Conversation

solid174
Copy link
Contributor

@solid174 solid174 commented Feb 7, 2025

Pull Request

The issue or feature being addressed

Fixes #2947

Details on the issue fix or feature implementation

Before version 6.6.2, OpenAPI file generation was identical for Linux and Windows, which allowed to correctly process files from different OS (including comparing them on CI), after the version, the carets in the text began to differ.

Example of how it was

{
“name": ‘SomeController’,
“description": “Some description.\r\n\n<br>\r\n\Some Parameter (para tag)\r\n\”
}

Example of what became

{
“name": ‘SomeController’,
“description": “Some description.\r\n[\r\n]|[\n]\r\n\Some Parameter (para tag)\r\n\”
}

That is, instead of
being identical when generated on different OS, different strings started to be generated.
The pool requester replaces the generation based on the EOL of the operating system with the EOL generation previously specified in this file (CLRF).

@solid174
Copy link
Contributor Author

solid174 commented Feb 7, 2025

Also, I see the possibility of adding configuration from SwaggerGeneratorOptions (with an additional field PrefferedXmlEol - Enum(CLRF, LF)), but I suppose that in this case it will be necessary to make XmlCommentsTextHelper DI service, with the name for example XmlCommentsTextHumanizer in order to be able to inject the generator options into it.

@solid174 solid174 marked this pull request as draft February 7, 2025 11:50
By default, it's based on operation system.
@solid174
Copy link
Contributor Author

solid174 commented Feb 7, 2025

Fixed with your suggestions, if there is anything to add or to improve, I will be glad to fix it!

@solid174 solid174 marked this pull request as ready for review February 7, 2025 13:03
@solid174 solid174 changed the title Specify EOL constant for XmlComments (#2947) Optional EOL for XmlComments (#2947) Feb 9, 2025
- Omit extra variables
- Add [ActivatorUtilitiesConstructor]
- Move definitions to Unshipped
- Restore legacy behavior of new lines
@solid174
Copy link
Contributor Author

Fixed. Please check out the updates

@martincostello martincostello added this to the v7.3.0 milestone Feb 12, 2025
@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 82.35294% with 6 lines in your changes missing coverage. Please review.

Project coverage is 83.74%. Comparing base (bafd6d6) to head (71a40b4).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...waggerGen/XmlComments/XmlCommentsDocumentFilter.cs 0.00% 1 Missing ⚠️
...aggerGen/XmlComments/XmlCommentsOperationFilter.cs 83.33% 1 Missing ⚠️
...aggerGen/XmlComments/XmlCommentsParameterFilter.cs 80.00% 1 Missing ⚠️
...gerGen/XmlComments/XmlCommentsRequestBodyFilter.cs 80.00% 1 Missing ⚠️
....SwaggerGen/XmlComments/XmlCommentsSchemaFilter.cs 83.33% 1 Missing ⚠️
...re.SwaggerGen/XmlComments/XmlCommentsTextHelper.cs 80.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3255      +/-   ##
==========================================
+ Coverage   83.64%   83.74%   +0.09%     
==========================================
  Files          76       76              
  Lines        3185     3192       +7     
  Branches      540      553      +13     
==========================================
+ Hits         2664     2673       +9     
+ Misses        521      519       -2     
Flag Coverage Δ
Linux 83.74% <82.35%> (+0.09%) ⬆️
Windows 83.74% <82.35%> (+0.09%) ⬆️
macOS 83.74% <82.35%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@martincostello martincostello left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

@martincostello martincostello merged commit 3c64558 into domaindrivendev:master Feb 12, 2025
9 checks passed
This was referenced Jul 31, 2025
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.

[Bug]: Swagger produces different swagger file on Linux
3 participants