File tree Expand file tree Collapse file tree
docusaurus-plugin-openapi-docs/src
docusaurus-theme-openapi-docs/src/theme/ApiDemoPanel/Request Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ custom_edit_url: null
2828{ {#frontMatter.proxy} }
2929proxy: { {{frontMatter.proxy} }}
3030{ {/frontMatter.proxy} }
31+ { {#frontMatter.hide_send_button} }
32+ hide_send_button: true
33+ { {/frontMatter.hide_send_button} }
3134---
3235
3336{ {{markdown} }}
Original file line number Diff line number Diff line change @@ -190,6 +190,9 @@ custom_edit_url: null
190190{{#frontMatter.proxy}}
191191proxy: {{{frontMatter.proxy}}}
192192{{/frontMatter.proxy}}
193+ {{#frontMatter.hide_send_button}}
194+ hide_send_button: true
195+ {{/frontMatter.hide_send_button}}
193196---
194197
195198{{{markdown}}}
Original file line number Diff line number Diff line change @@ -221,6 +221,9 @@ function createItems(
221221 . replace ( / \s + $ / , "" )
222222 : "" ,
223223 ...( options ?. proxy && { proxy : options . proxy } ) ,
224+ ...( options ?. hideSendButton && {
225+ hide_send_button : options . hideSendButton ,
226+ } ) ,
224227 } ,
225228 api : {
226229 ...defaults ,
@@ -338,6 +341,9 @@ function createItems(
338341 . replace ( / \s + $ / , "" )
339342 : "" ,
340343 ...( options ?. proxy && { proxy : options . proxy } ) ,
344+ ...( options ?. hideSendButton && {
345+ hide_send_button : options . hideSendButton ,
346+ } ) ,
341347 } ,
342348 api : {
343349 ...defaults ,
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export const OptionsSchema = Joi.object({
2727 outputDir : Joi . string ( ) . required ( ) ,
2828 template : Joi . string ( ) ,
2929 downloadUrl : Joi . string ( ) ,
30+ hideSendButton : Joi . boolean ( ) ,
3031 sidebarOptions : sidebarOptions ,
3132 version : Joi . string ( ) . when ( "versions" , {
3233 is : Joi . exist ( ) ,
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export interface APIOptions {
3333 outputDir : string ;
3434 template ?: string ;
3535 downloadUrl ?: string ;
36+ hideSendButton ?: boolean ;
3637 sidebarOptions ?: SidebarOptions ;
3738 version ?: string ;
3839 label ?: string ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ function Request({ item }: { item: NonNullable<ApiItem> }) {
2525 const response = useTypedSelector ( ( state : any ) => state . response . value ) ;
2626 const postman = new sdk . Request ( item . postman ) ;
2727 const metadata = useDoc ( ) ;
28- const { proxy } = metadata . frontMatter ;
28+ const { proxy, hide_send_button } = metadata . frontMatter ;
2929
3030 const params = {
3131 path : [ ] as ParameterObject [ ] ,
@@ -48,7 +48,9 @@ function Request({ item }: { item: NonNullable<ApiItem> }) {
4848 < summary >
4949 < div className = { `details__request-summary` } >
5050 < h4 > Request</ h4 >
51- { item . servers && < Execute postman = { postman } proxy = { proxy } /> }
51+ { item . servers && ! hide_send_button && (
52+ < Execute postman = { postman } proxy = { proxy } />
53+ ) }
5254 </ div >
5355 </ summary >
5456 < div className = { styles . optionsPanel } >
You can’t perform that action at this time.
0 commit comments