[GH-ISSUE #7152] Implement JSON Schema Validation for OpenAI API Responses #53300

Closed
opened 2026-05-05 14:34:40 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @c-hoffmann on GitHub (Nov 21, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7152

I was unable to find any JSON schema validation in the source code for the OpenAI API responses. This lack of validation can lead to potential issues when there are unexpected deviations in the response structure that may cause the application to behave incorrectly.

Preferred solution
I propose implementing JSON schema validation for the responses received from the OpenAI API. This validation will ensure that the responses conform to expected formats and enhance the overall reliability and security of the application.

Considered Alternatives
Currently, I don't know of any alternatives for validating the API responses.

Additional context
Implementing this validation is crucial for the security of Large Language Models (LLMs) and is a requirement outlined by the Open Web Application Security Project (OWASP) in their LLM Security Verification Standard.

Originally created by @c-hoffmann on GitHub (Nov 21, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/7152 I was unable to find any JSON schema validation in the source code for the OpenAI API responses. This lack of validation can lead to potential issues when there are unexpected deviations in the response structure that may cause the application to behave incorrectly. **Preferred solution** I propose implementing JSON schema validation for the responses received from the OpenAI API. This validation will ensure that the responses conform to expected formats and enhance the overall reliability and security of the application. **Considered Alternatives** Currently, I don't know of any alternatives for validating the API responses. **Additional context** Implementing this validation is crucial for the security of Large Language Models (LLMs) and is a requirement outlined by the Open Web Application Security Project (OWASP) in their [LLM Security Verification Standard](https://owasp.org/www-project-llm-verification-standard/).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#53300