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

fix(OpenApiType): Clean whitespace in description fields #160

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

provokateurin
Copy link
Member

@provokateurin provokateurin commented Aug 23, 2024

Fixes #140

@provokateurin
Copy link
Member Author

The only diff in server:

diff --git a/apps/files_sharing/openapi.json b/apps/files_sharing/openapi.json
index 79462697883..eb57971be93 100644
--- a/apps/files_sharing/openapi.json
+++ b/apps/files_sharing/openapi.json
@@ -1755,7 +1755,7 @@
                                     "expireDate": {
                                         "type": "string",
                                         "nullable": true,
-                                        "description": "The expiry date of the share in the user's timezone at 00:00.\n               If $expireDate is not supplied or set to `null`, the system default will be used."
+                                        "description": "The expiry date of the share in the user's timezone at 00:00. If $expireDate is not supplied or set to `null`, the system default will be used."
                                     },
                                     "note": {
                                         "type": "string",
@@ -2271,7 +2271,7 @@
                                     "sendMail": {
                                         "type": "string",
                                         "nullable": true,
-                                        "description": "if the share should be send by mail.\n                   Considering the share already exists, no mail will be send after the share is updated.\n \t\t\t\t  You will have to use the sendMail action to send the mail."
+                                        "description": "if the share should be send by mail. Considering the share already exists, no mail will be send after the share is updated. You will have to use the sendMail action to send the mail."
                                     }
                                 }
                             }

@nickvergessen
Copy link
Member

Should we allow new lines? I can see how it can help to improve readability?
But it seems ocs_api_viewer doesnt render them anyway?
grafik

@provokateurin
Copy link
Member Author

Sometimes the newlines are also not really there for readability and just to break the comment into multiple lines because it got too long. This makes sense for the phpdoc, but if displayed somewhere else the newline might be placed in an odd place.
So I don't think it is really possible to have sensible newlines, and as you already figured out they are not supported by every tool anyway.

@nickvergessen
Copy link
Member

So I don't think it is really possible to have sensible newlines, and as you already figured out they are not supported by every tool anyway.

I was thinking about "markdown style", so 2 direct newlines => real newline But yeah doesn't work for parameter docs anyway

@nickvergessen nickvergessen merged commit e8584a4 into main Aug 23, 2024
13 checks passed
@provokateurin provokateurin deleted the fix/openapitype/clean-doc-comments branch August 23, 2024 14:22
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.

Strip excessive whitespace in descriptions
2 participants