File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,7 +74,17 @@ const roleForm = reactive({})
7474
7575const setOperationDetails = (id : string , version : string ): void => {
7676 const operation = getOperationDetails (version , id , resourceDocs )
77- url .value = operation ?.specified_url
77+ // Replace the version in the URL with the current viewing version
78+ // This ensures users test against the version they're viewing (e.g., v6.0.0)
79+ // even if the endpoint was originally defined in an earlier version (e.g., v3.1.0)
80+ if (operation ?.specified_url ) {
81+ // Extract version without OBP prefix for URL replacement (e.g., "OBPv6.0.0" -> "v6.0.0")
82+ const versionWithoutPrefix = version .replace (' OBP' , ' ' )
83+ // Replace /obp/vX.X.X/ with the current version
84+ url .value = operation .specified_url .replace (/ \/ obp\/ v\d + \. \d + \. \d + \/ / , ` /obp/${versionWithoutPrefix }/ ` )
85+ } else {
86+ url .value = operation ?.specified_url
87+ }
7888 method .value = operation ?.request_verb
7989 exampleRequestBody .value = operation .example_request_body
8090 requiredRoles .value = operation .roles || []
You can’t perform that action at this time.
0 commit comments