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 request body properties are defined #43

Merged
merged 1 commit into from
Jun 30, 2024

Conversation

luquitared
Copy link
Contributor

@luquitared luquitared commented Jun 30, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

🔀 变更说明 | Description of Change

Sometimes when parsing more complex openapi schemas, this crash can happen:

Error processing request: TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at OpenAPIConvertor.convertOpenAPIToPluginSchema (/Users/lucasnegritto/projects/dynama-builder/tools-api/node_modules/@lobehub/chat-plugin-sdk/lib/openapi/index.js:55:45)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async convertManifest (/Users/lucasnegritto/projects/dynama-builder/tools-api/index.js:43:26)
    at async /Users/lucasnegritto/projects/dynama-builder/tools-api/index.js:74:54

By ensuring the request body properties are defined, we prevent trying to convert an undefined or null object to keys, avoiding the TypeError.

@lobehubbot
Copy link
Member

👍 @luquitared


Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@arvinxx arvinxx changed the title ensure request body properties are defined 🐛 fix: ensure request body properties are defined Jun 30, 2024
@arvinxx arvinxx merged commit 933b53c into lobehub:master Jun 30, 2024
3 of 4 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @luquitared ❤️


The growth of project is inseparable from user feedback and contribution, thanks for your contribution!
项目的成长离不开用户反馈和贡献,感谢您的贡献!

lobehubbot pushed a commit that referenced this pull request Jun 30, 2024
### [Version&nbsp;1.32.4](v1.32.3...v1.32.4)
<sup>Released on **2024-06-30**</sup>

#### 🐛 Bug Fixes

- **misc**: Ensure request body properties are defined.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Ensure request body properties are defined, closes [#43](#43) ([933b53c](933b53c))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.32.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants