swagger-api / swagger-api/swagger-ui

How to get current operation Id/tag inside wrapComponent?

Open
#5,030 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type: question
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

While writing a plugin, is there any way inside a wrapComponent like TryItOutButton, that we can extract the operationId of the current operation inside which these components are rendered. I tried finding any methods in the system object but could not find any. Any help would be much appreciated.

My basic intention is to fire an event when TryItOutButton is clicked with knowledge of OperationId under which the button was clicked.

Q&A
  • OS: Windows 10
  • Browser: Chrome
  • Version: 70
  • Method of installation: npm
  • Swagger-UI version: 3.18.0
  • Swagger/OpenAPI version: Swagger 2.0

Contributor guide

Open the contributing guide

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 plugin wrapComponent API and the TryItOutButton component mentioned in the issue, then trace how the current operation is passed into rendered components. Confirm whether operationId is available in that context and define completion as being able to identify the operation when TryItOutButton is clicked and use it for an event.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.