liuxiran edited a comment on issue #2082:
URL: https://github.com/apache/apisix/issues/2082#issuecomment-716356064
> * [ ] proxy-rewrite
>
I have **a proposal** for this header's schema modification: @juzhiyuan
- The schema provided by APISIX stays the same, because the type of
parameter in header can only be defined when the user designs it
- dashboard(plugin component) Adapt the schema that the user needs.
---
take `proxy-rewrite` as an example:
- the header schema returned by APISIX is:
```json
"headers": {
"description": "new headers for request",
"minProperties": 1,
"type": "object"
}
```
- dashboard adapt the header schema to:
```json
{
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "object",
"oneOf": [{
"title": "value type is string",
"properties": {
"value": {
"type": "string"
}
}
},
{
"title": "value type is number",
"properties": {
"value": {
"type": "number"
}
}
}]
}
}
}
}
```
- the `proxy-rewrite` config page in dashboard looks like:
[default looks]

[define parameters looks]

- the data posted to the APISIX:
```json
"proxy-rewrite": {
...configdata,
"headers": {
"token": {
"value": "345345-reertert"
}
}
}
```
if the header param's value is number, the post data would be:
```json
"proxy-rewrite": {
...configdata,
"headers": {
"token": {
"value": 32
}
}
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]