-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove autogenerated code samples when using x-codesamples #1036
Comments
Hi @tjperry07, thanks for bringing this up...I think there's a couple of approaches to solving for this:
Some other item/feature to consider would be whether or not custom languages should be supported, or languages that aren't already included in the default language set. Something else to consider is how |
I would do #2. Since It might be as simple as a check. For IDK. It's tricky and everyone will have a preference. I would add an option to the plugin to just turn off the Postman |
I've figured out a workaround for this. Add this to your custom.css. If the app changes, this will stop working. .tabs-container.openapi-tabs__code-container.openapi-tabs__code-container-inner:nth-child(2) {
display: none;
} Basically when there is a custom code sample for the language, it puts in the top row and moves the auto-gen to the bottom. If there is no custom code sample, it moves the auto-gen to the top row. hiding the bottom row means when a user clicks through they only see the custom samples or the auto-gen and not both. |
Btw, with a bit of experimentation I was able to suppress the generated variants simply by passing an empty |
Is your feature request related to a problem?
When add x-codeSamples, you have to enable the language in languageTabs to make it appear in the reference. This also makes the auto-generated ones appear.
Describe the solution you'd like
When using x-codeSamples for a specific language, the auto-generated ones should not appear or be a config option I can toggle on and off.
Describe alternatives you've considered
Turning off the language in question entirely
Editing the plugin code directly.
Tried to edit the CSS to hide the block, but they have the same CSS classes.
Additional context
If I went through the effort of creating custom code samples, I don't need the autogenerated ones.
The text was updated successfully, but these errors were encountered: