Kong / Kong/developer.konghq.com

There is an error in the definition of the Mocking Plugin's response.

Open Beginner friendly
#5,825 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

user-reported
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:

  • 200
  • 201
  • 204

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, and 204 in supported versions.
  • Explain how included_status_codes affects which status codes can be returned.
  • Explain that X-Kong-Mocking-Status-Code can be used to request a specific status code defined in the corresponding OpenAPI operation.
  • Clarify any version-specific behavior, if the 200 / 201 / 204 limitation applies only to older Kong Gateway versions.
  • Optionally add a small example showing a 404 or 400 response 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:

  • 200
  • 201
  • 204

Relevant changelog information from 3.1.0.0:

  • Added included_status_codes and random_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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.