Kong / Kong/developer.konghq.com
There is an error in the definition of the Mocking Plugin's response.
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 28
- Forks
- 121
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 313
Description
Jobs to be done (optional)
Users should be able to understand which HTTP status codes the Mocking plugin can return without needing to cross-check the plugin changelog.
Currently, the Mocking plugin page says under Mocked responses that the plugin can mock only the following responses:
200201204
However, the Mocking plugin changelog for 3.1.0.0 says that the plugin added included_status_codes, random_status_code, and support for All HTTP codes. It also says users can select a specific response with the X-Kong-Mocking-Status-Code behavioral header.
This can lead users to incorrectly conclude that the Mocking plugin cannot return 4xx or 5xx responses, even though newer versions appear to support them.
Definition of done
Update the Mocking plugin documentation so the Mocked responses section accurately reflects the current behavior.
Suggested updates:
- Clarify that the Mocking plugin supports HTTP status codes beyond
200,201, and204in supported versions. - Explain how
included_status_codesaffects which status codes can be returned. - Explain that
X-Kong-Mocking-Status-Codecan be used to request a specific status code defined in the corresponding OpenAPI operation. - Clarify any version-specific behavior, if the
200/201/204limitation applies only to older Kong Gateway versions. - Optionally add a small example showing a
404or400response in the OpenAPI spec and how to request it.
Information
Relevant docs:
- Mocking plugin page:
https://developer.konghq.com/plugins/mocking/#mocked-responses - Mocking plugin changelog
3.1.0.0:https://developer.konghq.com/plugins/mocking/changelog/#3-1-0-0
Current potentially misleading section:
The Mocking plugin can mock the following responses:
200201204
Relevant changelog information from 3.1.0.0:
- Added
included_status_codesandrandom_status_code - Added behavioral headers including
X-Kong-Mocking-Status-Code - Added support for All HTTP codes
Impact:
A user trying to use Kong Gateway as a mock server may incorrectly choose the Request Termination plugin for 4xx/5xx mocks because the Mocking plugin documentation appears to say that only 200, 201, and 204 are supported.
Due date (optional)
No specific due date.
Size
S
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Mocking plugin page's “Mocked responses” section and compare it with the 3.1.0.0 changelog entry. Verify the version-specific behavior for included_status_codes, random_status_code, and X-Kong-Mocking-Status-Code, then update the section so supported status codes and selection behavior are accurate, with an optional 400 or 404 example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100