[PR #2219] [MERGED] Bug/make swagger json output openapi 3 compliant #3923

Closed
opened 2026-02-22 18:34:46 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/2219
Author: @MrSimonC
Created: 9/4/2024
Status: Merged
Merged: 9/4/2024
Merged by: @timothycarambat

Base: masterHead: bug/make-swagger-json-output-openapi-3-compliant


📝 Commits (3)

  • 40e15ea update source to ensure swagger.json is openapi 3.0.0 compliant
  • b37bde5 Merge branch 'Mintplex-Labs:master' into bug/make-swagger-json-output-openapi-3-compliant
  • a5a1698 Merge branch 'Mintplex-Labs:master' into bug/make-swagger-json-output-openapi-3-compliant

📊 Changes

7 files changed (+18 additions, -52 deletions)

View changed files

📝 server/endpoints/api/admin/index.js (+0 -6)
📝 server/endpoints/api/document/index.js (+3 -7)
📝 server/endpoints/api/openai/index.js (+0 -2)
📝 server/endpoints/api/system/index.js (+0 -1)
📝 server/endpoints/api/workspace/index.js (+3 -6)
📝 server/endpoints/api/workspaceThread/index.js (+3 -4)
📝 server/swagger/openapi.json (+9 -26)

📄 Description

Pull Request Type

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

Relevant Issues

resolves #2218

What is in this change?

This pull request updates the Swagger API endpoint to generate a valid OpenAPI 3.0 specification. Specifically, the changes include:

  • Updates to the code to ensure that the generated openapi.json file conforms to the OpenAPI 3.0 specification.
  • Verification of the updated openapi.json file using the Swagger Parser Online Tool to ensure that it passes validation.

These changes address the issue reported in #1988, where the generated openapi.json file was found to be invalid against the OpenAPI 3.0 specification.

Additional Information

This change was motivated by the discovery that the output Swagger schema generated by OpenAPI Generator is not valid against the OpenAPI 3.0 specification. The Swagger Parser Online Tool was used to verify the changes and ensure that the updated openapi.json file is valid. The changes in this pull request should resolve the “invalid spec” error that was previously encountered when running the OpenAPI Generator CLI.

Developer Validations

To verify this, I:

  1. Copied the existing openapi.json file from https://raw.githubusercontent.com/Mintplex-Labs/anything-llm/master/server/swagger/openapi.json and inserted it into the Swagger Parser Online Tool, which confirmed that it fails validation.
  2. Updated the code in my pull request.
  3. Ran node '/workspaces/anything-llm/server/swagger/init.js' to regenerate openapi.json.
  4. Inserted the new openapi.json file into the Swagger Parser Online Tool, which now passes validation (indicated by a green light).
  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/2219 **Author:** [@MrSimonC](https://github.com/MrSimonC) **Created:** 9/4/2024 **Status:** ✅ Merged **Merged:** 9/4/2024 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `bug/make-swagger-json-output-openapi-3-compliant` --- ### 📝 Commits (3) - [`40e15ea`](https://github.com/Mintplex-Labs/anything-llm/commit/40e15ea4c68d32739cb444512043516a3b7f547a) update source to ensure swagger.json is openapi 3.0.0 compliant - [`b37bde5`](https://github.com/Mintplex-Labs/anything-llm/commit/b37bde5a43db38b3e87fc80ddf3e29edbe158de5) Merge branch 'Mintplex-Labs:master' into bug/make-swagger-json-output-openapi-3-compliant - [`a5a1698`](https://github.com/Mintplex-Labs/anything-llm/commit/a5a16987afb8fccec50c1b3393eb22ea61b5f3d7) Merge branch 'Mintplex-Labs:master' into bug/make-swagger-json-output-openapi-3-compliant ### 📊 Changes **7 files changed** (+18 additions, -52 deletions) <details> <summary>View changed files</summary> 📝 `server/endpoints/api/admin/index.js` (+0 -6) 📝 `server/endpoints/api/document/index.js` (+3 -7) 📝 `server/endpoints/api/openai/index.js` (+0 -2) 📝 `server/endpoints/api/system/index.js` (+0 -1) 📝 `server/endpoints/api/workspace/index.js` (+3 -6) 📝 `server/endpoints/api/workspaceThread/index.js` (+3 -4) 📝 `server/swagger/openapi.json` (+9 -26) </details> ### 📄 Description ### Pull Request Type - [ ] ✨ feat - [x] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues resolves #2218 ### What is in this change? This pull request updates the Swagger API endpoint to generate a valid OpenAPI 3.0 specification. Specifically, the changes include: - Updates to the code to ensure that the generated openapi.json file conforms to the OpenAPI 3.0 specification. - Verification of the updated openapi.json file using the Swagger Parser Online Tool to ensure that it passes validation. These changes address the issue reported in #1988, where the generated openapi.json file was found to be invalid against the OpenAPI 3.0 specification. ### Additional Information This change was motivated by the discovery that the output Swagger schema generated by OpenAPI Generator is not valid against the OpenAPI 3.0 specification. The Swagger Parser Online Tool was used to verify the changes and ensure that the updated openapi.json file is valid. The changes in this pull request should resolve the “invalid spec” error that was previously encountered when running the OpenAPI Generator CLI. ### Developer Validations <!-- All of the applicable items should be checked. --> To verify this, I: 1. Copied the existing `openapi.json` file from `https://raw.githubusercontent.com/Mintplex-Labs/anything-llm/master/server/swagger/openapi.json` and inserted it into the [Swagger Parser Online Tool](https://apitools.dev/swagger-parser/online/), which confirmed that it fails validation. 2. Updated the code in my pull request. 3. Ran `node '/workspaces/anything-llm/server/swagger/init.js'` to regenerate `openapi.json`. 4. Inserted the new `openapi.json` file into the [Swagger Parser Online Tool](https://apitools.dev/swagger-parser/online/), which now passes validation (indicated by a green light). - [ ] I ran `yarn lint` from the root of the repo & committed changes - [ ] Relevant documentation has been updated - [x] I have tested my code functionality - [ ] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:34:46 -05:00
yindo closed this issue 2026-02-22 18:34:46 -05:00
yindo changed title from [PR #2219] Bug/make swagger json output openapi 3 compliant to [PR #2219] [MERGED] Bug/make swagger json output openapi 3 compliant 2026-06-05 15:15:54 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#3923