-
Notifications
You must be signed in to change notification settings - Fork 534
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
Build plugin form according to its jsonschema #1039
Comments
Maybe we could use |
What a cool component library~! Recently, during my approach to #1241 , I rethought this issue:
The biggest advantage of direct configuration is full coverage of plugin function, we only need to improve its user experience. A: Several configuration templates are available, this is very helpful for most users, it will save the cost of study. cc @juzhiyuan |
Yep!
Besides, I will still try to build UI first, then export JSONSchema. 🤣🤣 |
yep, inspired by Aliyun API gateway, we could support both configuration template and UI form for users. Let us get this done to improve the plugin experience. 😄 |
ok, I'll look into what |
Could we store those templates in a JSON or YAML file in Dashboard repo haha? |
These templates would be better to be a part of part of the APISIX plugin document, and dashboard obtained by synchronizing data(if possible) |
maybe Apache APISIX will not store those data 😂 |
@LiteSun @juzhiyuan with discussion with @liuxiran , we guess the template could directly reuse the schema definition in APISIX, as well as extending the schemas by adding more examples and comments. We could call this The self-explanation API is right the doc and the template. We will then commit a proposal for the detailed framework. Looking forward to your insights. |
OK!! Looking forward to it! |
yep, there is something that we need to reach a conclusion with APISIX. At least, we could add more comments for each field in APISIX schema. 😈 |
While researching this issue, I found a very cool library: What the fake data looks likeTake
{
"break_response_code": 200,
"healthy": {
"http_statuses": [200],
"successes": 3
},
"max_breaker_sec": 300,
"unhealthy": {
"failures": 3,
"http_statuses": [500]
},
"disable": false
} How to add commentsThe fake data generated by If we want to add comments for the It's such a coincidence that there is an issue[2] in
{
"title": "plugin: api-breaker",
"description": "some information about api-breaker",
"$comment": "this is a mark for our injected plugin schema",
"properties": {
...
"break_response_code": {
"title": "break_response_code title",
"maximum": 599,
"minimum": 200,
"type": "integer",
"description": "comment for break_response_code"
},
"healthy": {
"default": {
"http_statuses": [200],
"successes": 3
},
"properties": {
"http_statuses": {
"default": [200],
"items": {
"maximum": 499,
"minimum": 200,
"type": "integer"
},
"minItems": 1,
"type": "array",
"uniqueItems": true,
"description": "comment for http_statuses"
},
"successes": {
"default": 3,
"minimum": 1,
"type": "integer",
"description": "comment for successes"
}
},
"type": "object"
},
},
"required": ["break_response_code"],
"type": "object"
} the yaml data with comments ## plugin: api-breaker
#
# some information about api-breaker
## break_response_code title ##
#
# comment for break_response_code
#
# Minimum value: 200
#
# Maximum value: 599
#
break_response_code: 200
## healthy ##
#
# Default value: [object Object]
#
healthy:
## http_statuses ##
#
# comment for http_statuses
#
# Default value: 200
#
http_statuses:
- 200
## successes ##
#
# comment for successes
#
# Default value: 3
#
# Minimum value: 1
#
successes: 3
## max_breaker_sec ##
#
# comment for max_breaker_sec
#
# Default value: 300
#
# Minimum value: 3
#
max_breaker_sec: 300
## unhealthy ##
#
# Default value: [object Object]
#
unhealthy:
## failures ##
#
# comment for unhealthy failures
#
# Default value: 3
#
# Minimum value: 1
#
failures: 3
## http_statuses ##
#
# comment for unhealthy http_statuses
#
# Default value: 500
#
http_statuses:
- 500
## disable ##
#
# comment for disable
#
disable: false What we planed to do
Looking forward to your insights @juzhiyuan @LiteSun @imjoey reference: |
This is very impressive and we love this solution for:
@juzhiyuan @LiteSun @membphis What's your opinions? Any feedback is welcome 😄 . Thanks. |
I talked about this issue with @juzhiyuan offline and we have reached the following consensus:
where would these configuration template stored? scenario1: # limit concurrency per client's IP
conn: 1 # the maximum number of concurrent requests allowed
burst: 0 # the number of excessive concurrent requests (or connections) allowed to be delayed
default_conn_delay: 0.1 # the default processing latency of a typical connection
rejected_code: 503 # returned when the request exceeds conn + burst will be rejected, default is 503
key: "remote_addr" # limit the concurrency level
scenario2: # limit concurrency per server's IP
conn: 1 # the maximum number of concurrent requests allowed
burst: 0 # the number of excessive concurrent requests (or connections) allowed to be delayed
default_conn_delay: 0.1 # the default processing latency of a typical connection
rejected_code: 503 # returned when the request exceeds conn + burst will be rejected, default is 503
key: "server_addr" # limit the concurrency level
...
Welcome any suggestions to improve the program |
The implement of #1039 (comment) will be divided into four parts:
we will try to do it step by step, welcome any suggestions to improve the program, thanks very much~ |
Great! 😉 |
LGTM @liuxiran |
I have a little doubt, where does the configuration template come from? And how do we maintain them. Thanks. @liuxiran |
The configuration template plans to define manually in a new dir e.g: The template would contain three parts:
|
ping @nic-chen |
@liuxiran |
Thanks @nic-chen, and your concern is really a problem indeed. It would be better to find a way to generate template reder to the different usage scenario, let me try to find it. |
Look forward to it, and thanks for that. |
I think use form to config plugins is the best solution.And we shuold also support to config custom plugins by from,not json or yaml. |
This issue has been marked as stale due to 30 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions. |
This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time. |
Feature request
Please describe your feature
It's more convenient to use a form instead of a code mirror to set up plugins, we used the
react-jsonschema-form
but most of the plugins couldn't be built perfectly.important issues
The text was updated successfully, but these errors were encountered: