AlinsRan opened a new pull request, #13543:
URL: https://github.com/apache/apisix/pull/13543
### What this fixes
Two documentation issues found during a docs audit:
**1. mocking — inaccurate constraint description**
`docs/{en,zh}/latest/plugins/mocking.md` state that `response_example` and
`response_schema` "must not be configured together". That is wrong: the schema
uses `anyOf` (at least one required), so configuring both is valid, and the
plugin prefers `response_example` when both are set:
```lua
-- apisix/plugins/mocking.lua
anyOf = {
{ required = { "response_example" } },
{ required = { "response_schema" } },
}
...
if conf.response_example then -- response_example wins when both set
response_content = conf.response_example
else
local output = gen_object(conf.response_schema)
```
Corrected to: at least one must be configured; if both are configured,
`response_example` takes precedence and `response_schema` is ignored.
**2. elasticsearch-logger — invalid JSON in examples**
The Admin API examples had a trailing comma after the only key (`"index":
"gateway",`), which makes the JSON invalid on copy-paste. Removed it (en + zh,
two places each).
### Checklist
- [x] I have explained the need for this PR and the problem it solves
- [x] I have explained the changes or the new features added to this PR
- [x] I have added tests corresponding to this change (N/A, docs only)
- [x] I have updated the documentation to reflect this change
- [x] I have verified that the changes pass the existing tests
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]