Skip to content

Conversation

@sharadregoti
Copy link
Contributor

@sharadregoti sharadregoti commented Oct 7, 2025

User description

Improved Tyk OAS documentation as per the Jira https://tyktech.atlassian.net/browse/DX-2102

Changes have already been added in the docs

Description

Related Issue

Motivation and Context

How This Has Been Tested

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring or add test (improvements in base code or adds test coverage to functionality)

Checklist

  • I ensured that the documentation is up to date
  • I explained why this PR updates go.mod in detail with reasoning why it's required
  • I would like a code coverage CI quality gate exception and have explained why

PR Type

Documentation


Description

  • Clarify Paths key semantics and examples

  • Document Operations keyed by operationID

  • Expand State.Internal exposure behavior details

  • Fix typo in ListenPath strip example


Diagram Walkthrough

flowchart LR
  Paths["Paths docs"] -- clarify keys/examples --> Middleware["Middleware struct context"]
  Operations["Operations docs"] -- key is operationID --> Operation["Operation definition"]
  StateInternal["State.Internal docs"] -- detail exposure behavior --> GatewayExposure["Gateway exposure rules"]
  ListenPath["ListenPath docs"] -- fix URL typo --> Example["Strip path example"]
Loading

File Walkthrough

Relevant files
Documentation
middleware.go
Clarify Paths map keys and context                                             

apidef/oas/middleware.go

  • Expand Paths comment with Middleware context
  • Explain string keys as URL patterns
+2/-1     
operation.go
Describe Operations keyed by operationID                                 

apidef/oas/operation.go

  • Document Operations map keyed by operationID
+1/-1     
root.go
Expand Internal field exposure semantics                                 

apidef/oas/root.go

  • Elaborate State.Internal behavior and references
+1/-1     
server.go
Fix ListenPath strip example URL                                                 

apidef/oas/server.go

  • Fix base URL typo in strip example
+1/-1     

@buger
Copy link
Member

buger commented Oct 7, 2025

💔 The detected issue is not in one of the allowed statuses 💔

Detected Status Backlog
Allowed Statuses In Dev,In Code Review,Ready for Testing,In Test,In Progress,In Review ✔️

Please ensure your jira story is in one of the allowed statuses

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2025

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Doc Link Validity

The new comment for State.Internal includes Hugo-style shortcodes/refs. Ensure these links are valid in the generated Go docs or are intended only for site docs; otherwise they may confuse readers and tooling.

// This field controls the exposure of the API on the Gateway. When set to `true`, the API will not be made available for external access and will not be included in API listings returned by the Gateway's management APIs; it will be accessible only via [internal looping]({{< ref "advanced-configuration/transform-traffic/looping" >}}) or as a [child API version]({{< ref "api-management/api-versioning#base-and-child-apis" >}}).
// Tyk classic API definition: `internal`
Internal bool `bson:"internal,omitempty" json:"internal,omitempty"`
Docs vs Behavior

The Paths comment adds examples of path patterns (e.g., /api/*). Verify these examples align with actual matcher semantics to avoid misleading documentation.

// Paths is a mapping of API endpoints to Path plugin configurations. This field is part of the [Middleware](#middleware) structure.
// The string keys in this object represent URL path patterns (e.g. `/users`, `/users/{id}`, `/api/*`) that match API endpoints.
type Paths map[string]*Path

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2025

API Changes

--- prev.txt	2025-10-07 12:00:31.659782286 +0000
+++ current.txt	2025-10-07 12:00:22.274742309 +0000
@@ -3561,7 +3561,7 @@
 
 	// Strip removes the inbound listen path (as accessed by the client) when generating the outbound request for the upstream service.
 	//
-	// For example, consider the scenario where the Tyk base address is `http://acme.com/', the listen path is `example/` and the upstream URL is `http://httpbin.org/`:
+	// For example, consider the scenario where the Tyk base address is `http://acme.com/`, the listen path is `example/` and the upstream URL is `http://httpbin.org/`:
 	//
 	// - If the client application sends a request to `http://acme.com/example/get` then the request will be proxied to `http://httpbin.org/example/get`
 	// - If stripListenPath is set to `true`, the `example` listen path is removed and the request would be proxied to `http://httpbin.org/get`.
@@ -3861,6 +3861,8 @@
 	Block *Allowance `bson:"block,omitempty" json:"block,omitempty"`
 
 	// IgnoreAuthentication ignores authentication on request by allowance.
+	//
+	// Tyk classic API definition: version_data.versions..extended_paths.ignored[].
 	IgnoreAuthentication *Allowance `bson:"ignoreAuthentication,omitempty" json:"ignoreAuthentication,omitempty"`
 
 	// Internal makes the endpoint only respond to internal requests.
@@ -3926,7 +3928,8 @@
     Import takes the arguments and populates the receiver *Operation values.
 
 type Operations map[string]*Operation
-    Operations holds Operation definitions.
+    Operations holds Operation definitions. The string key in this object is the
+    `operationID`, which is a unique identifier for each API operation.
 
 type PasswordAuthentication struct {
 	ClientAuthData
@@ -3978,6 +3981,9 @@
 
 type Paths map[string]*Path
     Paths is a mapping of API endpoints to Path plugin configurations.
+    This field is part of the Middleware(#middleware) structure. The string keys
+    in this object represent URL path patterns (e.g. `/users`, `/users/{id}`,
+    `/api/*`) that match API endpoints.
 
 func (ps Paths) ExtractTo(ep *apidef.ExtendedPathsSet)
     ExtractTo extracts Paths into *apidef.ExtendedPathsSet.
@@ -4075,6 +4081,8 @@
 	Block *Allowance `bson:"block,omitempty" json:"block,omitempty"`
 
 	// IgnoreAuthentication ignores authentication on request by allowance.
+	//
+	// Tyk classic API definition: version_data.versions..extended_paths.ignored[].
 	IgnoreAuthentication *Allowance `bson:"ignoreAuthentication,omitempty" json:"ignoreAuthentication,omitempty"`
 
 	// TransformRequestMethod allows you to transform the method of a request.
@@ -4593,7 +4601,10 @@
 	// Active enables the API so that Tyk will listen for and process requests made to the listenPath.
 	// Tyk classic API definition: `active`
 	Active bool `bson:"active" json:"active"` // required
-	// Internal makes the API accessible only internally.
+	// Internal controls the exposure of the API on the Gateway.
+	// When set to `true`, the API will not be made available for external access and will not be included in API listings returned by the Gateway's management APIs;
+	// it will be accessible only via [internal looping]({{< ref "advanced-configuration/transform-traffic/looping" >}}) or as a [child API version]({{< ref "api-management/api-versioning#base-and-child-apis" >}}).
+	//
 	// Tyk classic API definition: `internal`
 	Internal bool `bson:"internal,omitempty" json:"internal,omitempty"`
 }

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Remove non-code doc shortcodes

The comment embeds Hugo shortcodes/relative refs that will not render in code or
external docs, and may leak templating syntax. Replace with plain-text descriptions
or absolute doc links to avoid broken references in generated SDKs or tooling.

apidef/oas/root.go [134]

-// This field controls the exposure of the API on the Gateway. When set to `true`, the API will not be made available for external access and will not be included in API listings returned by the Gateway's management APIs; it will be accessible only via [internal looping]({{< ref "advanced-configuration/transform-traffic/looping" >}}) or as a [child API version]({{< ref "api-management/api-versioning#base-and-child-apis" >}}).
+// This field controls the exposure of the API on the Gateway. When set to `true`, the API is not externally accessible and is omitted from management API listings; it is accessible only via internal looping or as a child API version. See Tyk docs for details.
Suggestion importance[1-10]: 7

__

Why: Replacing Hugo shortcodes with plain text prevents leaking templating syntax into code comments and generated outputs. This is accurate and improves maintainability, though it's not a runtime bug.

Medium
Clarify listen path formatting

The example uses a listen path without a leading slash, which can cause confusion
versus actual values like /example/. Update the example to consistently include
leading/trailing slashes to match typical listen_path values and avoid
misconfiguration.

apidef/oas/server.go [203]

-// For example, consider the scenario where the Tyk base address is `http://acme.com/`, the listen path is `example/` and the upstream URL is `http://httpbin.org/`:
+// For example, consider the scenario where the Tyk base address is `http://acme.com/`, the listen path is `/example/` and the upstream URL is `http://httpbin.org/`:
Suggestion importance[1-10]: 6

__

Why: The example uses example/ without a leading slash, which can confuse users since Value examples include leading slashes. Updating to /example/ improves clarity, though it's a documentation tweak rather than a functional fix.

Low
Align key semantics in comment

The comment states keys are operationIDs; if the actual map keys differ (e.g., HTTP
method names or custom IDs), this can mislead users and tooling. Either ensure the
map keys truly are operation IDs or adjust the comment to reflect the real key
semantics to prevent runtime mismatches or incorrect lookups.

apidef/oas/operation.go [18]

-// Operations holds Operation definitions. The string key in this object is the `operationID`, which is a unique identifier for each API operation.
+// Operations holds Operation definitions. The string key is the operation ID (unique per API operation).
Suggestion importance[1-10]: 5

__

Why: The suggestion refines the comment to clearly state keys are operation IDs. It's consistent with the PR change and reduces potential confusion, but the impact is limited to documentation clarity.

Low

@probelabs
Copy link

probelabs bot commented Oct 7, 2025

🔍 Code Analysis Results

Change Impact Analysis

What this PR accomplishes

This pull request focuses on improving the inline documentation for Tyk's OpenAPI Specification (OAS) configuration structures. The changes clarify the purpose and usage of several key fields, correct a typo in an example, and provide more detailed explanations of behavior. These enhancements improve code readability and the accuracy of documentation generated from the source code, benefiting developers and users who work with Tyk's OAS definitions. This is a documentation-only change with no impact on runtime functionality.

Key technical changes introduced

The modifications are limited to Go code comments in the apidef/oas package:

  • apidef/oas/middleware.go: The comment for the Paths map is expanded to clarify that its keys are URL path patterns (e.g., /users, /users/{id}, /api/*), providing context on how middleware is applied to specific endpoints.
  • apidef/oas/operation.go: The documentation for the Operations map is updated to specify that it is keyed by the operationID, making it clear how individual API operations are uniquely identified.
  • apidef/oas/root.go: The explanation for the State.Internal field is significantly elaborated. It now details how setting this flag to true restricts the API's exposure on the gateway, making it accessible only for internal use cases like looping or child APIs.
  • apidef/oas/server.go: A minor typographical error in an example URL within the ListenPath documentation is corrected, ensuring the example is accurate and easy to understand.

Affected system components

The changes are strictly confined to code comments within the apidef/oas package. No executable code is altered. Therefore, the modifications have no effect on the runtime behavior of the Tyk gateway, its services, or any other system components. The primary impact is on the developer experience and the quality of the technical documentation.


Architecture Visualization

The diagram below illustrates the components within the Tyk OAS API Definition that have received documentation updates. It shows the hierarchical structure of the configuration and highlights where the clarifications have been made.

graph TD
    subgraph "Tyk OAS API Definition Structure"
        A[API Definition] --> S[State]
        A --> SRV[Server]
        A --> MW[Middleware]
        MW --> P[Paths]
        P --> PI[Path Item]
        PI --> O[Operations]
    end

    subgraph "Documentation Enhancements"
        style S fill:#cce5ff,stroke:#333,stroke-width:2px
        style SRV fill:#cce5ff,stroke:#333,stroke-width:2px
        style P fill:#cce5ff,stroke:#333,stroke-width:2px
        style O fill:#cce5ff,stroke:#333,stroke-width:2px

        S --|Clarified `Internal` flag behavior|--> S
        SRV --|Fixed typo in `ListenPath` strip example|--> SRV
        P --|Explained map keys are URL patterns|--> P
        O --|Specified map is keyed by `operationID`|--> O
    end
Loading

Diagram Explanation:

The architecture of a Tyk OAS API Definition is a structured configuration tree. This pull request does not change this structure but enhances the inline documentation for four key elements:

  1. State: The comment for the Internal field was expanded to provide a more detailed explanation of its role in controlling API exposure.
  2. Server: A typo in an example for the ListenPath configuration was corrected to improve clarity.
  3. Paths: The documentation now explicitly states that the keys for this map are URL patterns, clarifying how middleware is associated with API endpoints.
  4. Operations: The comment was updated to specify that the Operations map uses the unique operationID for its keys, which is crucial for identifying and managing individual operations.

Powered by Visor from Probelabs

Last updated: 2025-10-07T12:03:45.015Z | Triggered by: synchronize | Commit: 664658b

@probelabs
Copy link

probelabs bot commented Oct 7, 2025

🔍 Code Analysis Results

Security Issues (2)

Severity Location Issue
🟢 Info apidef/oas/root.go:135-136
The new comment for the `Internal` field contains lines that are significantly longer than standard Go style recommendations (typically 80-120 characters). This can make the code harder to read in terminals or side-by-side diff views.
💡 SuggestionWrap the long lines to improve readability and adhere to common Go style guidelines.
🔧 Suggested Fix
// When set to `true`, the API will not be made available for external access and
// will not be included in API listings returned by the Gateway's management APIs;
// it will be accessible only via [internal looping]({{< ref "advanced-configuration/transform-traffic/looping" >}})
// or as a [child API version]({{< ref "api-management/api-versioning#base-and-child-apis" >}}).
🟢 Info apidef/oas/root.go:136
The comment includes Hugo-specific shortcodes (`{{< ref ... >}}`) for linking to documentation. These will not render correctly in standard Go documentation tools like `godoc` and may be confusing for developers reading the source code directly.
💡 SuggestionFor better portability and developer experience within IDEs and standard tools, consider replacing the Hugo shortcodes with full URLs or a plain-text reference to the documentation section.
🔧 Suggested Fix
// it will be accessible only via internal looping or as a child API version. Please see the Tyk documentation for more details.

✅ Performance Check Passed

No performance issues found – changes LGTM.

✅ Quality Check Passed

No quality issues found – changes LGTM.

Style Issues (2)

Severity Location Issue
🟢 Info apidef/oas/root.go:135-136
The comment includes Hugo-specific shortcodes (`{{< ref ... >}}`) for linking to documentation. These will not render correctly in standard Go documentation tools like `godoc` and might be confusing for developers reading the source code directly.
💡 SuggestionFor better portability and to avoid leaking templating syntax into code comments, consider replacing the shortcodes with full URLs or plain-text references to the relevant documentation sections.
🟡 Warning apidef/oas/root.go:134-136
The new comment for the `Internal` field contains lines that are significantly longer than standard Go style recommendations (typically 80-120 characters), which harms readability in terminals and side-by-side diff views.
💡 SuggestionWrap the long comment lines to improve readability.
🔧 Suggested Fix
// Internal controls the exposure of the API on the Gateway.
// When set to `true`, the API will not be made available for external access and
// will not be included in API listings returned by the Gateway's management APIs;
// it will be accessible only via [internal looping]({{< ref "advanced-configuration/transform-traffic/looping" >}})
// or as a [child API version]({{< ref "api-management/api-versioning#base-and-child-apis" >}}).

Dependency Issues (1)


Severity Location Issue
🟢 Info apidef/oas/root.go:134-138
This pull request introduces documentation-only changes within Go source code comments to improve the clarity of the Tyk OAS (OpenAPI Specification) API definition. The modifications are confined to clarifying field semantics and correcting a typo in an example. There are no changes to code logic, data structures, schemas, or configuration.

Based on a thorough dependency impact analysis, these changes do not require any corresponding updates in downstream repositories (tyk-operator, tyk-charts, portal, tyk-sink).

Connectivity Issues (1)

Severity Location Issue
🟢 Info apidef/oas/root.go:134-138
The changes in this pull request are purely documentation updates within Go source code comments. They clarify the behavior of Tyk's OpenAPI (OAS) configuration fields but introduce no modifications to code logic, API schemas, configuration, or protocols related to Redis or RPC connectivity. The changes do not affect any of the key files responsible for connection handling, storage, or synchronization (e.g., `storage/*`, `rpc/*`, `gateway/redis_signals.go`). Therefore, this PR has no impact on Gateway connectivity.

Powered by Visor from Probelabs

Last updated: 2025-10-07T12:03:46.279Z | Triggered by: synchronize | Commit: 664658b

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 7, 2025

@lghiur lghiur merged commit bd0f86e into master Oct 7, 2025
47 of 48 checks passed
@lghiur lghiur deleted the DX-2102 branch October 7, 2025 14:31
@jay-deshmukh
Copy link
Contributor

/release to release-5.10.1

@tykbot
Copy link

tykbot bot commented Oct 28, 2025

Working on it! Note that it can take a few minutes.

tykbot bot pushed a commit that referenced this pull request Oct 28, 2025
### **User description**
<!-- Provide a general summary of your changes in the Title above -->

Improved Tyk OAS documentation as per the Jira
https://tyktech.atlassian.net/browse/DX-2102

Changes have already been added in the
[docs](https://github.com/TykTechnologies/tyk-docs/pull/6949)

## Description

<!-- Describe your changes in detail -->

## Related Issue

<!-- This project only accepts pull requests related to open issues. -->
<!-- If suggesting a new feature or change, please discuss it in an
issue first. -->
<!-- If fixing a bug, there should be an issue describing it with steps
to reproduce. -->
<!-- OSS: Please link to the issue here. Tyk: please create/link the
JIRA ticket. -->

## Motivation and Context

<!-- Why is this change required? What problem does it solve? -->

## How This Has Been Tested

<!-- Please describe in detail how you tested your changes -->
<!-- Include details of your testing environment, and the tests -->
<!-- you ran to see how your change affects other areas of the code,
etc. -->
<!-- This information is helpful for reviewers and QA. -->

## Screenshots (if appropriate)

## Types of changes

<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Refactoring or add test (improvements in base code or adds test
coverage to functionality)

## Checklist

<!-- Go over all the following points, and put an `x` in all the boxes
that apply -->
<!-- If there are no documentation updates required, mark the item as
checked. -->
<!-- Raise up any additional concerns not covered by the checklist. -->

- [ ] I ensured that the documentation is up to date
- [ ] I explained why this PR updates go.mod in detail with reasoning
why it's required
- [ ] I would like a code coverage CI quality gate exception and have
explained why


___

### **PR Type**
Documentation


___

### **Description**
- Clarify `Paths` key semantics and examples

- Document `Operations` keyed by `operationID`

- Expand `State.Internal` exposure behavior details

- Fix typo in `ListenPath` strip example


___

### Diagram Walkthrough


```mermaid
flowchart LR
  Paths["Paths docs"] -- clarify keys/examples --> Middleware["Middleware struct context"]
  Operations["Operations docs"] -- key is operationID --> Operation["Operation definition"]
  StateInternal["State.Internal docs"] -- detail exposure behavior --> GatewayExposure["Gateway exposure rules"]
  ListenPath["ListenPath docs"] -- fix URL typo --> Example["Strip path example"]
```



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>middleware.go</strong><dd><code>Clarify Paths map keys
and context</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/middleware.go

<ul><li>Expand <code>Paths</code> comment with Middleware context<br>
<li> Explain string keys as URL patterns</ul>


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+2/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>operation.go</strong><dd><code>Describe Operations
keyed by operationID</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/operation.go

- Document `Operations` map keyed by `operationID`


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>root.go</strong><dd><code>Expand Internal field
exposure semantics</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/root.go

- Elaborate `State.Internal` behavior and references


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-9c56b2bdb992e0a7db76809d4c516e1cd61c9486c7f0437b344c0032476af80f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>server.go</strong><dd><code>Fix ListenPath strip
example URL</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/server.go

- Fix base URL typo in strip example


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-21857c42e8659f7980014e277c3c758703f29e9e5c0c40553f2584cddb870808">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___

(cherry picked from commit bd0f86e)
@tykbot
Copy link

tykbot bot commented Oct 28, 2025

@jay-deshmukh Seems like there is conflict and it require manual merge.

jay-deshmukh pushed a commit that referenced this pull request Oct 28, 2025
…k OAS (#7419) (#7486)

### **User description**
[DX-2102] Bug Fixes and Improvements in Tyk OAS (#7419)

### **User description**
<!-- Provide a general summary of your changes in the Title above -->

Improved Tyk OAS documentation as per the Jira
https://tyktech.atlassian.net/browse/DX-2102

Changes have already been added in the
[docs](https://github.com/TykTechnologies/tyk-docs/pull/6949)

## Description

<!-- Describe your changes in detail -->

## Related Issue

<!-- This project only accepts pull requests related to open issues. -->
<!-- If suggesting a new feature or change, please discuss it in an
issue first. -->
<!-- If fixing a bug, there should be an issue describing it with steps
to reproduce. -->
<!-- OSS: Please link to the issue here. Tyk: please create/link the
JIRA ticket. -->

## Motivation and Context

<!-- Why is this change required? What problem does it solve? -->

## How This Has Been Tested

<!-- Please describe in detail how you tested your changes -->
<!-- Include details of your testing environment, and the tests -->
<!-- you ran to see how your change affects other areas of the code,
etc. -->
<!-- This information is helpful for reviewers and QA. -->

## Screenshots (if appropriate)

## Types of changes

<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Refactoring or add test (improvements in base code or adds test
coverage to functionality)

## Checklist

<!-- Go over all the following points, and put an `x` in all the boxes
that apply -->
<!-- If there are no documentation updates required, mark the item as
checked. -->
<!-- Raise up any additional concerns not covered by the checklist. -->

- [ ] I ensured that the documentation is up to date
- [ ] I explained why this PR updates go.mod in detail with reasoning
why it's required
- [ ] I would like a code coverage CI quality gate exception and have
explained why


___

### **PR Type**
Documentation


___

### **Description**
- Clarify `Paths` key semantics and examples

- Document `Operations` keyed by `operationID`

- Expand `State.Internal` exposure behavior details

- Fix typo in `ListenPath` strip example


___

### Diagram Walkthrough


```mermaid
flowchart LR
  Paths["Paths docs"] -- clarify keys/examples --> Middleware["Middleware struct context"]
  Operations["Operations docs"] -- key is operationID --> Operation["Operation definition"]
  StateInternal["State.Internal docs"] -- detail exposure behavior --> GatewayExposure["Gateway exposure rules"]
  ListenPath["ListenPath docs"] -- fix URL typo --> Example["Strip path example"]
```



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant

files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>middleware.go</strong><dd><code>Clarify Paths map keys
and context</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/middleware.go

<ul><li>Expand <code>Paths</code> comment with Middleware context<br>
<li> Explain string keys as URL patterns</ul>


</details>


  </td>
<td><a

href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+2/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>operation.go</strong><dd><code>Describe Operations
keyed by operationID</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/operation.go

- Document `Operations` map keyed by `operationID`


</details>


  </td>
<td><a

href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>root.go</strong><dd><code>Expand Internal field
exposure semantics</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/root.go

- Elaborate `State.Internal` behavior and references


</details>


  </td>
<td><a

href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-9c56b2bdb992e0a7db76809d4c516e1cd61c9486c7f0437b344c0032476af80f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>server.go</strong><dd><code>Fix ListenPath strip
example URL</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/server.go

- Fix base URL typo in strip example


</details>


  </td>
<td><a

href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-21857c42e8659f7980014e277c3c758703f29e9e5c0c40553f2584cddb870808">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___

[DX-2102]:
https://tyktech.atlassian.net/browse/DX-2102?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ


___

### **PR Type**
Documentation


___

### **Description**
- Clarify OAS Paths key semantics

- Document Operations keyed by operationID

- Expand State.Internal exposure behavior

- Fix ListenPath strip example typo


___

### Diagram Walkthrough


```mermaid
flowchart LR
  Paths["Paths map docs"] -- clarify key patterns --> Middleware["Middleware struct"]
  Ops["Operations map docs"] -- keys are operationID --> Operation["Operation struct"]
  StateInt["State.Internal docs"] -- detail exposure --> Gateway["Gateway visibility rules"]
  Listen["ListenPath docs"] -- fix base URL typo --> Example["Strip path example"]
```



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>middleware.go</strong><dd><code>Clarify Paths keys and
middleware context</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

apidef/oas/middleware.go

<ul><li>Explain <code>Paths</code> belongs to
<code>Middleware</code><br> <li> Define string keys as URL path
patterns<br> <li> Add classic definition note for
<code>IgnoreAuthentication</code></ul>


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7486/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+4/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>operation.go</strong><dd><code>Document Operations map
keyed by operationID</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/operation.go

<ul><li>State Operations keyed by <code>operationID</code><br> <li> Add
classic mapping note for IgnoreAuthentication</ul>


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7486/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+3/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>root.go</strong><dd><code>Elaborate State.Internal
gateway exposure behavior</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/root.go

<ul><li>Expand <code>State.Internal</code> exposure semantics<br> <li>
Note internal looping and child API access</ul>


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7486/files#diff-9c56b2bdb992e0a7db76809d4c516e1cd61c9486c7f0437b344c0032476af80f">+4/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>server.go</strong><dd><code>Correct ListenPath strip
example URL</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/server.go

<ul><li>Fix base URL typo in strip example<br> <li> Keep example
behavior unchanged</ul>


</details>


  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7486/files#diff-21857c42e8659f7980014e277c3c758703f29e9e5c0c40553f2584cddb870808">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___

Co-authored-by: Master <sharadregoti15@gmail.com>
@sharadregoti
Copy link
Contributor Author

/release to release-5.8

@sharadregoti
Copy link
Contributor Author

/release to release-5.8.9

probelabs bot pushed a commit that referenced this pull request Dec 10, 2025
### **User description**
<!-- Provide a general summary of your changes in the Title above -->

Improved Tyk OAS documentation as per the Jira
https://tyktech.atlassian.net/browse/DX-2102

Changes have already been added in the
[docs](https://github.com/TykTechnologies/tyk-docs/pull/6949)

## Description

<!-- Describe your changes in detail -->

## Related Issue

<!-- This project only accepts pull requests related to open issues. -->
<!-- If suggesting a new feature or change, please discuss it in an
issue first. -->
<!-- If fixing a bug, there should be an issue describing it with steps
to reproduce. -->
<!-- OSS: Please link to the issue here. Tyk: please create/link the
JIRA ticket. -->

## Motivation and Context

<!-- Why is this change required? What problem does it solve? -->

## How This Has Been Tested

<!-- Please describe in detail how you tested your changes -->
<!-- Include details of your testing environment, and the tests -->
<!-- you ran to see how your change affects other areas of the code,
etc. -->
<!-- This information is helpful for reviewers and QA. -->

## Screenshots (if appropriate)

## Types of changes

<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Refactoring or add test (improvements in base code or adds test
coverage to functionality)

## Checklist

<!-- Go over all the following points, and put an `x` in all the boxes
that apply -->
<!-- If there are no documentation updates required, mark the item as
checked. -->
<!-- Raise up any additional concerns not covered by the checklist. -->

- [ ] I ensured that the documentation is up to date
- [ ] I explained why this PR updates go.mod in detail with reasoning
why it's required
- [ ] I would like a code coverage CI quality gate exception and have
explained why

___

### **PR Type**
Documentation

___

### **Description**
- Clarify `Paths` key semantics and examples

- Document `Operations` keyed by `operationID`

- Expand `State.Internal` exposure behavior details

- Fix typo in `ListenPath` strip example

___

### Diagram Walkthrough

```mermaid
flowchart LR
  Paths["Paths docs"] -- clarify keys/examples --> Middleware["Middleware struct context"]
  Operations["Operations docs"] -- key is operationID --> Operation["Operation definition"]
  StateInternal["State.Internal docs"] -- detail exposure behavior --> GatewayExposure["Gateway exposure rules"]
  ListenPath["ListenPath docs"] -- fix URL typo --> Example["Strip path example"]
```

<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>middleware.go</strong><dd><code>Clarify Paths map keys
and context</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/middleware.go

<ul><li>Expand <code>Paths</code> comment with Middleware context<br>
<li> Explain string keys as URL patterns</ul>

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+2/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>operation.go</strong><dd><code>Describe Operations
keyed by operationID</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/operation.go

- Document `Operations` map keyed by `operationID`

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>root.go</strong><dd><code>Expand Internal field
exposure semantics</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/root.go

- Elaborate `State.Internal` behavior and references

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-9c56b2bdb992e0a7db76809d4c516e1cd61c9486c7f0437b344c0032476af80f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>server.go</strong><dd><code>Fix ListenPath strip
example URL</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/server.go

- Fix base URL typo in strip example

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-21857c42e8659f7980014e277c3c758703f29e9e5c0c40553f2584cddb870808">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___

(cherry picked from commit bd0f86e)
@probelabs
Copy link

probelabs bot commented Dec 10, 2025

✅ Cherry-pick successful. A PR was created: #7619

@sharadregoti
Copy link
Contributor Author

/release to release-5.11

probelabs bot pushed a commit that referenced this pull request Dec 10, 2025
### **User description**
<!-- Provide a general summary of your changes in the Title above -->

Improved Tyk OAS documentation as per the Jira
https://tyktech.atlassian.net/browse/DX-2102

Changes have already been added in the
[docs](https://github.com/TykTechnologies/tyk-docs/pull/6949)

## Description

<!-- Describe your changes in detail -->

## Related Issue

<!-- This project only accepts pull requests related to open issues. -->
<!-- If suggesting a new feature or change, please discuss it in an
issue first. -->
<!-- If fixing a bug, there should be an issue describing it with steps
to reproduce. -->
<!-- OSS: Please link to the issue here. Tyk: please create/link the
JIRA ticket. -->

## Motivation and Context

<!-- Why is this change required? What problem does it solve? -->

## How This Has Been Tested

<!-- Please describe in detail how you tested your changes -->
<!-- Include details of your testing environment, and the tests -->
<!-- you ran to see how your change affects other areas of the code,
etc. -->
<!-- This information is helpful for reviewers and QA. -->

## Screenshots (if appropriate)

## Types of changes

<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Refactoring or add test (improvements in base code or adds test
coverage to functionality)

## Checklist

<!-- Go over all the following points, and put an `x` in all the boxes
that apply -->
<!-- If there are no documentation updates required, mark the item as
checked. -->
<!-- Raise up any additional concerns not covered by the checklist. -->

- [ ] I ensured that the documentation is up to date
- [ ] I explained why this PR updates go.mod in detail with reasoning
why it's required
- [ ] I would like a code coverage CI quality gate exception and have
explained why

___

### **PR Type**
Documentation

___

### **Description**
- Clarify `Paths` key semantics and examples

- Document `Operations` keyed by `operationID`

- Expand `State.Internal` exposure behavior details

- Fix typo in `ListenPath` strip example

___

### Diagram Walkthrough

```mermaid
flowchart LR
  Paths["Paths docs"] -- clarify keys/examples --> Middleware["Middleware struct context"]
  Operations["Operations docs"] -- key is operationID --> Operation["Operation definition"]
  StateInternal["State.Internal docs"] -- detail exposure behavior --> GatewayExposure["Gateway exposure rules"]
  ListenPath["ListenPath docs"] -- fix URL typo --> Example["Strip path example"]
```

<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>middleware.go</strong><dd><code>Clarify Paths map keys
and context</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/middleware.go

<ul><li>Expand <code>Paths</code> comment with Middleware context<br>
<li> Explain string keys as URL patterns</ul>

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+2/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>operation.go</strong><dd><code>Describe Operations
keyed by operationID</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/operation.go

- Document `Operations` map keyed by `operationID`

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>root.go</strong><dd><code>Expand Internal field
exposure semantics</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/root.go

- Elaborate `State.Internal` behavior and references

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-9c56b2bdb992e0a7db76809d4c516e1cd61c9486c7f0437b344c0032476af80f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>server.go</strong><dd><code>Fix ListenPath strip
example URL</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/server.go

- Fix base URL typo in strip example

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-21857c42e8659f7980014e277c3c758703f29e9e5c0c40553f2584cddb870808">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___

(cherry picked from commit bd0f86e)
@probelabs
Copy link

probelabs bot commented Dec 10, 2025

⚠️ Cherry-pick encountered conflicts. A draft PR was created: #7620

@sharadregoti
Copy link
Contributor Author

/release to release-5.11.0

@probelabs
Copy link

probelabs bot commented Dec 10, 2025

✅ Cherry-pick successful. A PR was created: #7621

@probelabs
Copy link

probelabs bot commented Dec 10, 2025

⚠️ Cherry-pick encountered conflicts. A draft PR was created: #7622

sharadregoti added a commit that referenced this pull request Dec 11, 2025
<!-- Provide a general summary of your changes in the Title above -->

Improved Tyk OAS documentation as per the Jira
https://tyktech.atlassian.net/browse/DX-2102

Changes have already been added in the
[docs](https://github.com/TykTechnologies/tyk-docs/pull/6949)

<!-- Describe your changes in detail -->

<!-- This project only accepts pull requests related to open issues. -->
<!-- If suggesting a new feature or change, please discuss it in an
issue first. -->
<!-- If fixing a bug, there should be an issue describing it with steps
to reproduce. -->
<!-- OSS: Please link to the issue here. Tyk: please create/link the
JIRA ticket. -->

<!-- Why is this change required? What problem does it solve? -->

<!-- Please describe in detail how you tested your changes -->
<!-- Include details of your testing environment, and the tests -->
<!-- you ran to see how your change affects other areas of the code,
etc. -->
<!-- This information is helpful for reviewers and QA. -->

<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Refactoring or add test (improvements in base code or adds test
coverage to functionality)

<!-- Go over all the following points, and put an `x` in all the boxes
that apply -->
<!-- If there are no documentation updates required, mark the item as
checked. -->
<!-- Raise up any additional concerns not covered by the checklist. -->

- [ ] I ensured that the documentation is up to date
- [ ] I explained why this PR updates go.mod in detail with reasoning
why it's required
- [ ] I would like a code coverage CI quality gate exception and have
explained why

___

Documentation

___

- Clarify `Paths` key semantics and examples

- Document `Operations` keyed by `operationID`

- Expand `State.Internal` exposure behavior details

- Fix typo in `ListenPath` strip example

___

```mermaid
flowchart LR
  Paths["Paths docs"] -- clarify keys/examples --> Middleware["Middleware struct context"]
  Operations["Operations docs"] -- key is operationID --> Operation["Operation definition"]
  StateInternal["State.Internal docs"] -- detail exposure behavior --> GatewayExposure["Gateway exposure rules"]
  ListenPath["ListenPath docs"] -- fix URL typo --> Example["Strip path example"]
```

<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>middleware.go</strong><dd><code>Clarify Paths map keys
and context</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/middleware.go

<ul><li>Expand <code>Paths</code> comment with Middleware context<br>
<li> Explain string keys as URL patterns</ul>

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+2/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>operation.go</strong><dd><code>Describe Operations
keyed by operationID</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/operation.go

- Document `Operations` map keyed by `operationID`

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>root.go</strong><dd><code>Expand Internal field
exposure semantics</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/root.go

- Elaborate `State.Internal` behavior and references

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-9c56b2bdb992e0a7db76809d4c516e1cd61c9486c7f0437b344c0032476af80f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>server.go</strong><dd><code>Fix ListenPath strip
example URL</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/server.go

- Fix base URL typo in strip example

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-21857c42e8659f7980014e277c3c758703f29e9e5c0c40553f2584cddb870808">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___

(cherry picked from commit bd0f86e)
sharadregoti added a commit that referenced this pull request Dec 11, 2025
<!-- Provide a general summary of your changes in the Title above -->

Improved Tyk OAS documentation as per the Jira
https://tyktech.atlassian.net/browse/DX-2102

Changes have already been added in the
[docs](https://github.com/TykTechnologies/tyk-docs/pull/6949)

<!-- Describe your changes in detail -->

<!-- This project only accepts pull requests related to open issues. -->
<!-- If suggesting a new feature or change, please discuss it in an
issue first. -->
<!-- If fixing a bug, there should be an issue describing it with steps
to reproduce. -->
<!-- OSS: Please link to the issue here. Tyk: please create/link the
JIRA ticket. -->

<!-- Why is this change required? What problem does it solve? -->

<!-- Please describe in detail how you tested your changes -->
<!-- Include details of your testing environment, and the tests -->
<!-- you ran to see how your change affects other areas of the code,
etc. -->
<!-- This information is helpful for reviewers and QA. -->

<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Refactoring or add test (improvements in base code or adds test
coverage to functionality)

<!-- Go over all the following points, and put an `x` in all the boxes
that apply -->
<!-- If there are no documentation updates required, mark the item as
checked. -->
<!-- Raise up any additional concerns not covered by the checklist. -->

- [ ] I ensured that the documentation is up to date
- [ ] I explained why this PR updates go.mod in detail with reasoning
why it's required
- [ ] I would like a code coverage CI quality gate exception and have
explained why

___
Documentation

___
- Clarify `Paths` key semantics and examples

- Document `Operations` keyed by `operationID`

- Expand `State.Internal` exposure behavior details

- Fix typo in `ListenPath` strip example

___

```mermaid
flowchart LR
  Paths["Paths docs"] -- clarify keys/examples --> Middleware["Middleware struct context"]
  Operations["Operations docs"] -- key is operationID --> Operation["Operation definition"]
  StateInternal["State.Internal docs"] -- detail exposure behavior --> GatewayExposure["Gateway exposure rules"]
  ListenPath["ListenPath docs"] -- fix URL typo --> Example["Strip path example"]
```

<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>middleware.go</strong><dd><code>Clarify Paths map keys
and context</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/middleware.go

<ul><li>Expand <code>Paths</code> comment with Middleware context<br>
<li> Explain string keys as URL patterns</ul>

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+2/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>operation.go</strong><dd><code>Describe Operations
keyed by operationID</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/operation.go

- Document `Operations` map keyed by `operationID`

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>root.go</strong><dd><code>Expand Internal field
exposure semantics</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/root.go

- Elaborate `State.Internal` behavior and references

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-9c56b2bdb992e0a7db76809d4c516e1cd61c9486c7f0437b344c0032476af80f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>server.go</strong><dd><code>Fix ListenPath strip
example URL</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/server.go

- Fix base URL typo in strip example

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-21857c42e8659f7980014e277c3c758703f29e9e5c0c40553f2584cddb870808">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___

(cherry picked from commit bd0f86e)
sharadregoti added a commit that referenced this pull request Dec 11, 2025
<!-- Provide a general summary of your changes in the Title above -->

Improved Tyk OAS documentation as per the Jira
https://tyktech.atlassian.net/browse/DX-2102

Changes have already been added in the
[docs](https://github.com/TykTechnologies/tyk-docs/pull/6949)

<!-- Describe your changes in detail -->

<!-- This project only accepts pull requests related to open issues. -->
<!-- If suggesting a new feature or change, please discuss it in an
issue first. -->
<!-- If fixing a bug, there should be an issue describing it with steps
to reproduce. -->
<!-- OSS: Please link to the issue here. Tyk: please create/link the
JIRA ticket. -->

<!-- Why is this change required? What problem does it solve? -->

<!-- Please describe in detail how you tested your changes -->
<!-- Include details of your testing environment, and the tests -->
<!-- you ran to see how your change affects other areas of the code,
etc. -->
<!-- This information is helpful for reviewers and QA. -->

<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Refactoring or add test (improvements in base code or adds test
coverage to functionality)

<!-- Go over all the following points, and put an `x` in all the boxes
that apply -->
<!-- If there are no documentation updates required, mark the item as
checked. -->
<!-- Raise up any additional concerns not covered by the checklist. -->

- [ ] I ensured that the documentation is up to date
- [ ] I explained why this PR updates go.mod in detail with reasoning
why it's required
- [ ] I would like a code coverage CI quality gate exception and have
explained why

___
Documentation

___
- Clarify `Paths` key semantics and examples

- Document `Operations` keyed by `operationID`

- Expand `State.Internal` exposure behavior details

- Fix typo in `ListenPath` strip example

___

```mermaid
flowchart LR
  Paths["Paths docs"] -- clarify keys/examples --> Middleware["Middleware struct context"]
  Operations["Operations docs"] -- key is operationID --> Operation["Operation definition"]
  StateInternal["State.Internal docs"] -- detail exposure behavior --> GatewayExposure["Gateway exposure rules"]
  ListenPath["ListenPath docs"] -- fix URL typo --> Example["Strip path example"]
```

<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>middleware.go</strong><dd><code>Clarify Paths map keys
and context</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/middleware.go

<ul><li>Expand <code>Paths</code> comment with Middleware context<br>
<li> Explain string keys as URL patterns</ul>

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+2/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>operation.go</strong><dd><code>Describe Operations
keyed by operationID</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/operation.go

- Document `Operations` map keyed by `operationID`

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>root.go</strong><dd><code>Expand Internal field
exposure semantics</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

apidef/oas/root.go

- Elaborate `State.Internal` behavior and references

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-9c56b2bdb992e0a7db76809d4c516e1cd61c9486c7f0437b344c0032476af80f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>server.go</strong><dd><code>Fix ListenPath strip
example URL</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

apidef/oas/server.go

- Fix base URL typo in strip example

</details>

  </td>
<td><a
href="https://github.com/TykTechnologies/tyk/pull/7419/files#diff-21857c42e8659f7980014e277c3c758703f29e9e5c0c40553f2584cddb870808">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___

(cherry picked from commit bd0f86e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants