File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
packages/docusaurus-plugin-openapi-docs/src/markdown Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,8 @@ export function myCustomApiMdGenerator({
4949 `import StatusCodes from "@theme/StatusCodes";\n` ,
5050 `import OperationTabs from "@theme/OperationTabs";\n` ,
5151 `import TabItem from "@theme/TabItem";\n` ,
52- `import Heading from "@theme/Heading";\n\n` ,
52+ `import Heading from "@theme/Heading";\n` ,
53+ `import { translate } from "@docusaurus/Translate";\n\n` ,
5354 createHeading ( title ) ,
5455 createMethodEndpoint ( method , path ) ,
5556 createServersTable ( servers ) ,
Original file line number Diff line number Diff line change 77
88import { create } from "./utils" ;
99
10- export function createRequestHeader ( ) {
10+ export function createRequestHeader ( header : string ) {
1111 return [
1212 create ( "Heading" , {
13- id : "request" ,
13+ id : header . replace ( " " , "-" ) . toLowerCase ( ) ,
1414 as : "h2" ,
1515 className : "openapi-tabs__heading" ,
1616 children : [
17- " {translate({ id: 'theme.openapi.request.title', message: 'Request ' })}" ,
17+ ` {translate({ id: 'theme.openapi.request.title', message: '${ header } ' })}` ,
1818 ] ,
1919 } ) ,
2020 "\n\n" ,
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ export function createApiPageMD({
8282 : undefined ,
8383 createDeprecationNotice ( { deprecated, description : deprecatedDescription } ) ,
8484 createDescription ( description ) ,
85- requestBody || parameters ? createRequestHeader ( ) : undefined ,
85+ requestBody || parameters ? createRequestHeader ( "Request" ) : undefined ,
8686 createParamsDetails ( { parameters } ) ,
8787 createRequestBodyDetails ( {
8888 title : "Body" ,
You can’t perform that action at this time.
0 commit comments