[PR #3757] [CLOSED] feat: allow dumping of configuration JSON Schema #4824

Closed
opened 2026-05-05 14:49:28 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/3757
Author: @akx
Created: 11/8/2023
Status: Closed

Base: devHead: schema


📝 Commits (1)

  • 597b506 feat: allow dumping of configuration JSON Schema

📊 Changes

5 files changed (+79 additions, -5 deletions)

View changed files

📝 cmd/frpc/sub/root.go (+11 -3)
📝 cmd/frps/root.go (+10 -2)
📝 go.mod (+5 -0)
📝 go.sum (+11 -0)
pkg/util/util/cli.go (+42 -0)

📄 Description

Summary

🤖 Generated by Copilot at 657e592

Add a feature to dump the JSON schema of the client and server configuration to stdout. This feature uses the reflect and util packages and introduces new flags to the frpc and frps commands. It also adds new dependencies to the go.mod file.

WHY

For software that needs to generate frp configuration programmatically, it's useful to be able to validate the generated configuration before passing it to frp.

That software can now do ./frpc --json_schema > frpc.config.json and use their favorite JSON Schema validator from there on out.

For instance, the generated client configuration schema looks like this: https://gist.github.com/akx/5c1a605e2624ee75131b4a684f235a82

Powered by https://github.com/invopop/jsonschema (❤️)


🔄 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/fatedier/frp/pull/3757 **Author:** [@akx](https://github.com/akx) **Created:** 11/8/2023 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `schema` --- ### 📝 Commits (1) - [`597b506`](https://github.com/fatedier/frp/commit/597b50683301c1bed46291136d83734ae40537e3) feat: allow dumping of configuration JSON Schema ### 📊 Changes **5 files changed** (+79 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `cmd/frpc/sub/root.go` (+11 -3) 📝 `cmd/frps/root.go` (+10 -2) 📝 `go.mod` (+5 -0) 📝 `go.sum` (+11 -0) ➕ `pkg/util/util/cli.go` (+42 -0) </details> ### 📄 Description ### Summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at 657e592</samp> Add a feature to dump the JSON schema of the client and server configuration to stdout. This feature uses the `reflect` and `util` packages and introduces new flags to the `frpc` and `frps` commands. It also adds new dependencies to the `go.mod` file. ### WHY For software that needs to generate frp configuration programmatically, it's useful to be able to validate the generated configuration before passing it to frp. That software can now do `./frpc --json_schema > frpc.config.json` and use their favorite JSON Schema validator from there on out. For instance, the generated client configuration schema looks like this: https://gist.github.com/akx/5c1a605e2624ee75131b4a684f235a82 Powered by https://github.com/invopop/jsonschema (❤️) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 14:49:28 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#4824
No description provided.