File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed
gitbook/src/components/DocumentView/OpenAPI Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @gitbook/react-openapi " : patch
3+ " gitbook " : patch
4+ ---
5+
6+ OpenAPI: Make responses without objects clickable
Original file line number Diff line number Diff line change 565565}
566566
567567.openapi-example-empty {
568- @apply relative text-tint bg-tint min-h-20 flex flex-col justify-center items-center;
568+ @apply relative text-tint min-h-20 flex flex-col justify-center items-center text-sm ;
569569}
570570
571571/* Common Elements */
@@ -746,6 +746,10 @@ body:has(.openapi-select-popover) {
746746 @apply px-3 transition-all;
747747}
748748
749+ .openapi-disclosure-group-trigger [aria-expanded = "true" ] > .openapi-disclosure-group-label {
750+ @apply font-medium;
751+ }
752+
749753.openapi-disclosure-group-trigger [aria-expanded = "true" ] > .openapi-disclosure-group-icon > svg {
750754 @apply rotate-90;
751755}
Original file line number Diff line number Diff line change @@ -50,6 +50,20 @@ export function OpenAPIResponses(props: {
5050 ] ;
5151 }
5252
53+ if ( ! response . content ) {
54+ return [
55+ {
56+ key : 'default' ,
57+ label : '' ,
58+ body : (
59+ < pre className = "openapi-example-empty" >
60+ < p > { t ( context . translation , 'no_content' ) } </ p >
61+ </ pre >
62+ ) ,
63+ } ,
64+ ] ;
65+ }
66+
5367 return Object . entries ( response . content ?? { } ) . map ( ( [ contentType , mediaType ] ) => ( {
5468 key : contentType ,
5569 label : contentType ,
You can’t perform that action at this time.
0 commit comments