@redocly/asyncapi-docs
Version:
Async API docs for Redocly Realm
2 lines (1 loc) • 1.24 kB
JavaScript
var f=function(r,o){var n={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.indexOf(e)<0&&(n[e]=r[e]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,e=Object.getOwnPropertySymbols(r);t<e.length;t++)o.indexOf(e[t])<0&&Object.prototype.propertyIsEnumerable.call(r,e[t])&&(n[e[t]]=r[e[t]]);return n};import{jsx as a,Fragment as g,jsxs as u}from"react/jsx-runtime";import{JsonViewer as h}from"@redocly/theme";import{useAtomValue as b}from"jotai";import{makeDeepLink as y}from"@redocly/openapi-docs";import{BindingPanel as O}from"./common";import{JsonSchema as s}from"./JsonSchema";import{getSchema as p}from"../utils";import{routingBasePathAtom as j}from"../jotai/app";const v=({binding:r,id:o})=>{const n=b(j),e=o?.replace(`/${n}/`,""),t=`/${n}${y(e,"")}`;return a(O,{header:"Operation configuration",children:(({key:c,value:i})=>{const{bindingVersion:x}=i,m=f(i,["bindingVersion"]);switch(c){case"kafka":const d={type:"object",properties:{groupId:p(i.groupId)}},l={type:"object",properties:{clientId:p(i.clientId)}};return u(g,{children:[i.groupId&&a(s,{schema:d,slug:t}),i.clientId&&a(s,{schema:l,slug:t})]});default:return a(h,{data:m,expandLevel:3,hideHeader:!0})}})(r)})};export{v as OperationBinding};