[PR #283] feat: Add JSON Schema generation for plugin manifests #284

Open
opened 2026-02-15 21:16:35 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-sdks/pull/283
Author: @yamachu
Created: 1/19/2026
Status: 🔄 Open

Base: mainHead: feat/generate-json-schema


📝 Commits (3)

  • f711fd0 feat: add output file option and json-schema support for documentation generation
  • 8e54634 feat: add documentation for parameter types
  • 22985e0 feat: implement JSON Schema generation for Pydantic models and Enums

📊 Changes

8 files changed (+262 additions, -3 deletions)

View changed files

📝 python/dify_plugin/cli.py (+18 -1)
📝 python/dify_plugin/commands/generate_docs.py (+7 -2)
📝 python/dify_plugin/core/documentation/generator.py (+213 -0)
📝 python/dify_plugin/entities/agent.py (+3 -0)
📝 python/dify_plugin/entities/datasource_manifest.py (+3 -0)
📝 python/dify_plugin/entities/provider_config.py (+3 -0)
📝 python/dify_plugin/entities/tool.py (+9 -0)
📝 python/dify_plugin/entities/trigger.py (+6 -0)

📄 Description

Summary

  • Generate JSON Schema alongside docs so VS Code + Red Hat YAML extension can validate plugin YAML manifests using $schema.
  • Example usage in VS Code: manifest.yaml
# yaml-language-server: $schema=schema.json#/definitions/Manifest

version: 0.0.1
type: plugin
author: yamachu
...
スクリーンショット 2026-01-20 1 59 31
  • Note: schemas with identical names are not fully disambiguated yet (e.g., multiple Python definitions may be merged). This will need a follow-up refinement if collisions appear.

I tested ...

  • uv run ./dify_plugin/cli.py generate-docs
  • uv run ./dify_plugin/cli.py generate-docs --format json-schema

Pull Request Checklist

Thank you for your contribution! Before submitting your PR, please make sure you have completed the following checks:

Compatibility Check

  • I have checked whether this change affects the backward compatibility of the plugin declared in README.md
  • I have checked whether this change affects the forward compatibility of the plugin declared in README.md
  • If this change introduces a breaking change, I have discussed it with the project maintainer and specified the release version in the README.md
  • I have described the compatibility impact and the corresponding version number in the PR description
  • I have checked whether the plugin version is updated in the README.md

Available Checks

  • Code has passed local tests
  • Relevant documentation has been updated (if necessary)

🔄 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/langgenius/dify-plugin-sdks/pull/283 **Author:** [@yamachu](https://github.com/yamachu) **Created:** 1/19/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/generate-json-schema` --- ### 📝 Commits (3) - [`f711fd0`](https://github.com/langgenius/dify-plugin-sdks/commit/f711fd0bf1e3423df023d9fe9ca338fad8eebf8c) feat: add output file option and json-schema support for documentation generation - [`8e54634`](https://github.com/langgenius/dify-plugin-sdks/commit/8e54634b117af2c9378bf2ea658fd8a3662d19c6) feat: add documentation for parameter types - [`22985e0`](https://github.com/langgenius/dify-plugin-sdks/commit/22985e0a0f8d97372b58fa6d43902a7a12f934ce) feat: implement JSON Schema generation for Pydantic models and Enums ### 📊 Changes **8 files changed** (+262 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `python/dify_plugin/cli.py` (+18 -1) 📝 `python/dify_plugin/commands/generate_docs.py` (+7 -2) 📝 `python/dify_plugin/core/documentation/generator.py` (+213 -0) 📝 `python/dify_plugin/entities/agent.py` (+3 -0) 📝 `python/dify_plugin/entities/datasource_manifest.py` (+3 -0) 📝 `python/dify_plugin/entities/provider_config.py` (+3 -0) 📝 `python/dify_plugin/entities/tool.py` (+9 -0) 📝 `python/dify_plugin/entities/trigger.py` (+6 -0) </details> ### 📄 Description ## Summary - Generate JSON Schema alongside docs so VS Code + Red Hat YAML extension can validate plugin YAML manifests using `$schema`. - Example usage in VS Code: manifest.yaml ```yaml # yaml-language-server: $schema=schema.json#/definitions/Manifest version: 0.0.1 type: plugin author: yamachu ... ``` <img width="518" height="238" alt="スクリーンショット 2026-01-20 1 59 31" src="https://github.com/user-attachments/assets/f91e91c5-fcae-46c6-ab7b-770a765b6922" /> - Note: schemas with identical names are not fully disambiguated yet (e.g., multiple `Python` definitions may be merged). This will need a follow-up refinement if collisions appear. I tested ... - `uv run ./dify_plugin/cli.py generate-docs` - `uv run ./dify_plugin/cli.py generate-docs --format json-schema` # Pull Request Checklist Thank you for your contribution! Before submitting your PR, please make sure you have completed the following checks: ## Compatibility Check - [x] I have checked whether this change affects the **backward compatibility** of the plugin declared in `README.md` - [x] I have checked whether this change affects the **forward compatibility** of the plugin declared in `README.md` - [x] If this change introduces a breaking change, I have discussed it with the project maintainer and specified the release version in the `README.md` - [x] I have described the compatibility impact and the corresponding version number in the PR description - [x] I have checked whether the plugin version is updated in the `README.md` ## Available Checks - [ ] Code has passed local tests - [ ] Relevant documentation has been updated (if necessary) --- <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-15 21:16:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-sdks#284