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: ensure summaries + descriptions are strings #764

Merged
merged 2 commits into from
May 23, 2023

Conversation

kanadgupta
Copy link
Member

🚥 Fixes ISSUE_ID

🧰 Changes

  • Fixes an error that users were seeing in this issue: this.schema.description.trim is not a function
  • Reverts our .trim() logic since that's technically unexpected behavior.

🧬 QA & Testing

Do tests pass?

@kanadgupta kanadgupta added the bug Something isn't working label May 23, 2023
@kanadgupta kanadgupta requested a review from erunion May 23, 2023 21:58
src/operation.ts Outdated
if (this.schema?.summary) {
return this.schema.summary.trim();
if (this.schema?.summary && typeof this.schema.summary === 'string') {
return this.schema.summary;
} else if (this.api.paths[this.path].summary) {
Copy link
Member

Choose a reason for hiding this comment

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

Want to add this typeof logic to these other blocks? These ones handle callback objects.

@kanadgupta kanadgupta requested a review from erunion May 23, 2023 22:17
@erunion erunion merged commit 2b1338e into main May 23, 2023
@erunion erunion deleted the fix/summaries-and-descriptions-as-strings branch May 23, 2023 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants