fumadocs-openapi 12.6.8 → 12.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- @source inline("!collapsed !headers !isSecret !readOnly !renderBodyField !required !returned *:flex-1 *:justify-center *:min-w-0 --accordion-panel-height --active-tab-height --active-tab-left --active-tab-top --active-tab-width --anchor-width --available-height --collapsible-panel-height --fd-docs-height --fd-docs-row-3 --spacing --transform-origin -me-3 -mode -ms-0.5 -ms-2 -mt-1 -my-1 -z-1 @4xl:flex @4xl:flex-col @4xl:flex-row @4xl:items-start @4xl:max-h-[calc(var(--fd-docs-height,100dvh)-var(--fd-docs-row-3,0px)-2rem)] @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-3,0px)+1rem)] @4xl:w-[400px] @container @default @defaultValue @deprecated @fuma-translate/react @fumadocs/json-schema @fumari/stf @max-sm:bg-fd-secondary/50 @max-sm:border @max-sm:mx-4 @max-sm:overflow-hidden @max-sm:pb-1.5 @max-sm:pb-3 @max-sm:pt-2 @max-sm:rounded-lg @max-xl:basis-full @max-xl:border-t @max-xl:flex-1 @max-xl:ps-1.5 @md:block @param @returns @scalar/api-client-react @see @sm:border-s @sm:flex @sm:grid-cols-[minmax(9rem,1fr)_minmax(0,2fr)] @sm:min-h-10 @sm:min-w-0 @xl:w-40 [&>div:has(>figcaption)]:h-10 [&[hidden]:not([hidden='until-found'])]:hidden [&_a]:underline [&_code]:font-mono [&_figcaption]:font-medium [&_figcaption]:overflow-visible [&_figcaption]:text-[0.8125rem] [&_figcaption]:text-fd-foreground [&_figcaption]:text-xs [&_svg]:size-3 [&_svg]:size-3.5 [--fd-docs-row-3:0px] [grid-area:1/1] [scrollbar-width:none] a abort about above absolute accept access access_token accordion accordions across action actions active:scale-[0.97] activity actual adapter adapters add addLogEntry added adding additional additionalProperties adds after again against alias align aligns all allOf allow allowCopy allowJson allowed already also alt among an anchor anchorSegments and animate-spin animates another any anyFields anyOf apiExample apiKey apiPlayground appearance-none application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml applied applies apply are aren aria-checked aria-current aria-expanded aria-expanded:bg-fd-accent aria-expanded:decoration-solid aria-expanded:text-fd-accent-foreground aria-hidden aria-label aria-live aria-pressed arkdown array arrow arrows as aside async at audience auth authNode authProviders authSchemes authenticate authorization authorizationCode authorizationUrl authorization_code authorization_pending authorization_url authorize authorized authorizes auto-cols-[minmax(0,max-content)] autoComplete available avoid await away back backdrop-blur-[1px] backdrop-blur-xs badgeVariants bar base basic basis-full be bearer before behavior below beside between bg-amber-500 bg-amber-500/10 bg-black/40 bg-blue-500 bg-current/10 bg-fd-accent bg-fd-background bg-fd-card bg-fd-card/70 bg-fd-muted bg-fd-muted-foreground bg-fd-muted-foreground/50 bg-fd-popover bg-fd-primary bg-fd-primary/10 bg-fd-secondary bg-green-500 bg-linear-to-b bg-linear-to-t bg-red-500 bg-transparent binary block blocked blocks blue body bodyMediaType bodyNode bodyUrlRef boolean border border-0 border-b border-b-0 border-current border-dashed border-fd-border/60 border-fd-muted-foreground/50 border-fd-primary border-s border-t border-x-0 bottom bottom-0 box box-content breadcrumbs break-all browser browsers built-in builtinAuthProviders builtinProviders bundled busy but button buttonVariants buttons by bytes cache cached cachedDocFiles callbacks callbacksNode came can cancel cancelled candidates cannot caption captionCodeBlock captioned card cardCodeBlock cards case catch cause cell center certificate ch challenge change changes changing charset check checkbox checked chevron chevronClassName children chosen class class-variance-authority className cleanup clear clearResponse click clicking client client-rendered clientAuth clientCredentials clientId clientSecret clientWidth client_auth client_credentials client_error client_id client_secret clients cloned close closeDelay closed closest cn code codeProps codeUsages code_challenge code_challenge_method code_verifier codeblock col-span-2 col-span-full col-start-2 collapse collapses color colors column come component components compute confidential config configUrl configuration configurations connecting connection const constraints consumers container content contentTypes contents control controller controllerRef controls cookie cookieString cookies copies copy copyable copying core could count covered covers createContext createOAuthHandler createOpenAPIPage createOpenAPIPageBase createProxy created credentials cross-origin crumbClassName crumbs css csv ctions ctx current currentValue cursor-help cursor-pointer cursor-text custom customise customization cyan dark dark-mode dark:bg-fd-accent dark:text-amber-400 dark:text-blue-400 dark:text-cyan-400 dark:text-green-400 dark:text-orange-400 dark:text-red-400 dark:text-yellow-400 data data-[disabled]:opacity-50 data-[disabled]:pointer-events-none data-[highlighted]:bg-fd-accent data-[highlighted]:text-fd-accent-foreground data-active:text-fd-foreground data-checked data-checked:bg-fd-primary data-checked:bg-fd-primary-foreground data-checked:text-fd-accent-foreground data-checked:translate-x-3 data-empty:hidden data-ending-style:duration-150 data-ending-style:h-0 data-ending-style:opacity-0 data-ending-style:scale-95 data-ending-style:scale-[0.97] data-ending-style:scale-[0.98] data-highlighted:bg-fd-accent data-highlighted:text-fd-accent-foreground data-placeholder:text-fd-muted-foreground data-popup-open:bg-fd-accent data-popup-open:text-fd-accent-foreground data-popup-open:underline data-starting-style:h-0 data-starting-style:opacity-0 data-starting-style:scale-95 data-starting-style:scale-[0.98] dataEngine decimal declare decode decoration-dotted default defaultColor defaultMdxComponents defaultShikiFactory defaultShikiOptions defaultValue defaultValues defaults define definitions delay delay-150 delete deprecated depth dereference dereferenced described describes description descriptionNode descriptions detail details device deviceAuthorization deviceAuthorizationUrl device_authorization_url device_code devices dialog didn direction directories disable disableCache disabled disabled:cursor-not-allowed disabled:opacity-50 disabled:opacity-80 discovered discovering display displayNames disposition div doc docCache docFilesCache docRoot docs document documents does doesn domain don download downloaded drives drop duplicated duration duration-150 duration-200 duration-250 duration-300 dynamic dynamicSource e each eading early ease-[cubic-bezier(0.16,1,0.3,1)] ease-[cubic-bezier(0.22,1,0.36,1)] ease-out edge edit edited editing editor edits element elements else empty enabled encode encodeRequestData end ending endpoint endpoints ends enforce engine enter entered entries entry enum err error error_description errors eslint-disable-next-line even every example exampleCardClassName exampleCodeBlock examples exclusiveMax exclusiveMin expand expanded expands expected expiresAt expires_in export exported expressions extended extends fades failed fallback false fast-content-type-parse fd-page-tree-item-name fd-scroll-container fetch fetchOptions fetcher field field-sizing-content fieldData fieldName fields file fileName files fill-current filled filling fills filter filterable finally finishes finishing first first:border-t-0 first:mt-0 fixed flattened flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flow-root flowInfo flowReturned flows flushSync focus-visible:bg-fd-accent focus-visible:bg-fd-accent/40 focus-visible:bg-fd-primary/15 focus-visible:bg-fd-secondary focus-visible:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-fd-primary/30 focus-visible:ring-fd-ring focus-visible:ring-inset focus-visible:text-fd-accent-foreground focus-within:ring-1 focus-within:ring-fd-ring focus:outline-hidden focus:ring focus:ring-0 focus:ring-fd-ring follow font-light font-medium font-mono font-normal font-sans font-semibold for form form-encoded format forward fragment frameworks from from-fd-popover full fumadocs-core/highlight fumadocs-core/source fumadocs-core/toc fumadocs-openapi-flow fumadocs-openapi-oauth fumadocs-openapi-oauth-returned fumadocs-ui/mdx fumadocs:openapi fumadocs_openapi_requests function gap-0.5 gap-1 gap-1.5 gap-2 gap-2.5 gap-24 gap-3 gap-4 gap-x-2 gap-x-3 gap-x-6 gap-y-1 gap-y-4 generate generateDefault generateSchemaUI generateTypeScriptDefinitions generated generators get getLink getOpenAPIPageProps getPageProps getPreferredType getRaw getSchema getSchemas getState gets ghost github-dark github-light given gives go goes going grant_type grant_types_supported grants gray green grid grid-cols-[auto_minmax(0,1fr)] grid-cols-[auto_minmax(0,1fr)_auto] grid-cols-[minmax(0,1fr)_auto] grid-cols-[minmax(0,2fr)_minmax(0,3fr)] grid-flow-col grid-rows-[auto_minmax(0,1fr)] group group-data-[panel-open]/accordion:rotate-90 group-data-popup-open:rotate-180 group-hover/nav:translate-x-0.5 group-hover/open:translate-x-0.5 group-hover/property:opacity-100 group-hover:translate-x-0.5 group-hover:translate-x-px group/accordion group/nav group/open group/property group/row h-(--accordion-panel-height) h-(--active-tab-height) h-(--collapsible-panel-height) h-10 h-12 h-4 h-6 h-7 h-8 h-9 h-[calc(--spacing(10)-1px)] h-full h-px h1 handle handled handles happens has has-focus-visible:bg-fd-secondary hasVariables hash have headNode header headerRef headers heading headingLevel headless here hidden hiddenKeys highlighted highlighter highlights hint holding hook hour hour12 hover hover:bg-fd-accent hover:bg-fd-accent/40 hover:bg-fd-accent/50 hover:bg-fd-primary/15 hover:text-fd-accent-foreground hover:underline how href html htmlFor http i icon icon-sm icon-xs iconButtonClassName id idx if img implicit import imports in includeDocument including index indicator info infoTags init initAuth initial inline inline-flex input inputMode inputs inset-0 inset-x-0 inside installed instanceof instead integer interface interval into invalid invisible is isCopied isDynamic isExpanded isHighlighted isLazy isLoading isMac isNumber isSecret isSending isn issues it item itemSchema itemToStringValue items items-baseline items-center items-start items-stretch its itself js json json-schema-typed justify-between justify-center justify-end k kB keep keeps kept key keyboard keyed keyof keys kind label labelled lang language languages larger last last:border-b-0 last:shrink-0 lasts latest layout layouts lazy leading-5 leading-[1.375rem] leading-relaxed leave leaving left left-0 length let light light-mode like line line-clamp-3 line-through link links list listed listener listeners literal live load loadDocument loaded loaderPlugin loading loads location lock locked log long longer looks lowercase lucide-react make malformed many map mapValues margin margins marked masked match matches matching max max-age max-h-(--available-height) max-h-[min(18rem,30vh)] max-h-[min(var(--available-height),20rem)] max-h-none max-md:hidden max-w-1/2 max-w-40 max-w-60 max-w-64 max-w-72 max-w-80 max-w-[calc(100vw-2rem)] max-w-full maxEntries may mb-3 mb-4 md md:border-s md:grid-cols-[minmax(0,11fr)_minmax(0,9fr)] md:hidden me-1 me-2 me-auto measure measured measures media mediaAdapters mediaType member members memoized menu menuItems merge message messages metaData metaKey method methods milliseconds mime min min-h-0 min-h-10 min-h-11 min-h-60 min-h-9 min-h-full min-w-0 min-w-16 min-w-40 min-w-[calc(var(--anchor-width)+--spacing(2))] minute mode more motion motion-reduce:transition-none motion-reduce:transition-opacity motion-safe:-translate-x-6 motion-safe:animate-pulse motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0.16,1,0.3,1)] motion-safe:starting:-translate-x-2 motion-safe:starting:-translate-x-6 motion-safe:starting:-translate-y-4 motion-safe:starting:opacity-0 motion-safe:starting:scale-0 motion-safe:starting:scale-150 motion-safe:starting:translate-x-2 motion-safe:starting:translate-x-6 motion-safe:starting:translate-y-1 motion-safe:starting:translate-y-4 motion-safe:transition-[opacity,translate] motion-safe:transition-opacity motion-safe:transition-transform motionClassNames mounts move moves ms ms-1 ms-1.5 ms-auto mt-0! mt-0.5 mt-1 mt-1.5 mt-10 mt-2.5 mt-px multi-type multipart/form-data multiple must muted mutual mutualTLS mx-3 mx-px my-0! my-1 my-3 name name! nameClassName named names namespace narrow nav navigate navigated navigator nearest needs nested network never new next next/previous nextId no no-cache noValidate node noreferrer normalizes not not-first:border-s not-prose note now null number oauth oauth2 oauthRedirectUrl object objectGet objects observer obtain of off ok older omit omitted on onAppend onAuthorize onBack onCancel onChange onCheckedChange onClear onClick onCopy onKeyDown onLink onNavigate onOpenChange onRemove onReset onReturn onRoot onSelect onSubmit onUserCode onValueChange once one oneOf ones only opacity-0 opacity-60 opacity-80 open openApiData openIdConnect openIdConnectUrl openNested openOnHover openOnInputClick openapi openapiMeta opened opening opens operation optional options or orange origin origin-(--transform-origin) other others otherwise out outline-hidden output outside over overflow-auto overflow-clip overflow-hidden overflow-x-auto overflow-y-auto override overview own p-0.5 p-1 p-1.5 p-2 p-2.5 p-3 p-4 p-5 p-6 packages padding page pageData pages panel panelCodeBlock panelKey panelTopCodeBlock panels param parameter parameterLabel parameterNode parameters params parent parentIndex parents parsed parts party pass password paste patch path pathItem pathnameFromRequest pattern patternProperties payload pb-1 pb-2 pb-2.5 pb-3 pe-1 pe-1.5 pe-2 pe-3 pe-4 pendingFlowKey per persisted pill place placed placeholder placeholder:font-sans placeholder:text-fd-muted-foreground placeholder:text-fd-muted-foreground/70 placeholder:text-fd-primary/50 plain playground playgrounds please plugins pointer-coarse:opacity-100 polite poll polling popover pops popup port position postForm pre preferred prefers preloadOpenAPIPage preloaded presents prev preventDefault preview previous primary primitive private processor prop properties property props prose prose-no-margin prose-sm prose-xs provider providers proxied proxy proxyForwardCookie proxyUrl ps-1 ps-1.5 ps-3 ps-3.5 ps-4 ps-6 pt-1.5 pt-2 pt-2.5 public px-1 px-1.5 px-2 px-2.5 px-3 px-4 py-0 py-0.5 py-1 py-1.5 py-2 py-2.5 py-3 py-6 py-8 q query quiet random range raw reach react react-dom react-hooks/exhaustive-deps read read-only readOnly readers readonly reads received record red redirect redirectUrl redirect_uri redirected redirects ref reference refs regenerated rejected rejects rel relative reloading remark remark-rehype remarkGfm remarkRehype remembered remounted removable removal remove removeItem removed render renderAPIExampleUsageTabs renderBodyField renderCodeblock renderDefault renderMarkdown renderParameterField rendered renderers renders replace replaces represents request request-body requestBody requestData requestInit requestTimeout requestUrl requested requesting requests required requirement requirements res reset resize-none resized resolve resolveMediaAdapter resolveUrl resolved resolvedInput resolvedTheme resolves respond response response-body responseNode responseTabs response_type responses rest restore restored result return returned returnedFlow returnedScheme returnedUrl returning returns reversed revoked right ring-1 ring-3 ring-fd-border ring-green-500/20 role room root rootId rounded-[5px] rounded-full rounded-lg rounded-md rounded-none rounded-sm rounded-xl route row row-span-2 row-start-1 row-start-2 rowButtonClassName rows run runtime s safeParse same sample satisfies says scalar scan schema schemaId schemaKeys schemaUI schemas scheme schemeId schemes scope scopeOptions scopes scopes_supported screen screens scroll scroll-m-20 scroll-mt-[calc(var(--fd-docs-row-3,0px)+1rem)] scrollArrowClassName scrollMarginClassName scrolling search second secondary seconds secret secretSchema secrets section sectionIcons sectionNames sections security see segment segmentClassName segments segs select select-all select-none selectExample selectable selected selectedCodeUsages selectedType selecting selection selector selectors selects self-center self-stretch send sender sending sends sent server server-to-server serverSchema serverUrl servers services session sessionStorage set setAuthorizing setClientAuth setCode setCollapsed setDraft setFilter setIndex setInfo setMode setMotion setName setOpen setResponse setScopes setSelected setSelectedFor setSending setServerVariables setShowSchema setStack setType setUserCode setValue setView several shadow-lg shadow-md shadow-none shadow-sm share shared shared-api/auto-anchor shared-api/source shiki shikiOptions shortcut shorten show showDescription showExample showResponseSchema showTitle shown shows shrink shrink-0 shrinks sibling siblings side sideOffset signal signing single sits size size-2 size-3 size-3.5 size-4 size-5 skipNonRequired skipReadOnly slashes slides sliding slots slow_down sm sm:-translate-x-1/2 sm:-translate-y-1/2 sm:border sm:h-[min(52rem,calc(100dvh-3rem))] sm:inline sm:inset-auto sm:left-1/2 sm:max-h-[min(52rem,calc(100dvh-3rem))] sm:mb-4 sm:mx-4 sm:ps-5 sm:px-4 sm:rounded-2xl sm:shadow-2xl sm:top-1/2 sm:w-[min(64rem,calc(100vw-3rem))] sm:w-[min(80rem,calc(100vw-3rem))] small smaller smooth so some something space spellCheck sr-only src stable stack start started starting starting:opacity-0 starts state staticSource status statusInfo stay stays step stf sticky still stops storage storageKey storageKeyPrefix store stored string stringifyFieldKey structuredData style styles submit subscribe subscribeNever successful such suggestions summary suspends svg switch switches switching sync syncExample synced t tPlayground tab tabIndex tabs tabular-nums tag tagClassName taken takes target telling text text-4xl text-[0.8125rem] text-amber-600 text-blue-600 text-center text-cyan-600 text-fd-accent-foreground text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-muted-foreground/60 text-fd-muted-foreground/70 text-fd-popover-foreground text-fd-primary text-fd-primary-foreground text-fd-secondary-foreground text-green-600 text-nowrap text-orange-600 text-red-400 text-red-600 text-sm text-start text-xl text-xs text-yellow-600 text/css text/csv text/html text/plain texts than that the their them themes then there they this three through throw time timeFormat timeout timer timerRef tips title titleBarClassName tls to to-transparent toStaticData toVirtualFiles toc toggle toggled token tokenUrl token_type token_url top top-(--active-tab-top) top-0 total tracking-tight tracking-widest transform transformPageTree transition-[background-color,scale] transition-[height,opacity] transition-[height] transition-[opacity,scale] transition-[translate,background-color] transition-[translate,width] transition-colors transition-opacity transition-shadow transition-transform transitionClassName translate-x-(--active-tab-left) translations trigger true truncate truncating try turns type typeClassName typeof types typing undefined under underline underline-offset-4 undici union unionField unions unique unit unknown unless unset unsetting until up update updateInfo updated updating upper url urn:ietf:params:oauth:grant-type:device_code usage usageTabs usages use useAnchorId useAnchorLink useApiClient useComponents useCopyButton useDataEngine useEffect useFieldValue useListener useMemo useNamespace useOnChange useOpenAPI useOperation useQuery useRef useRenderContext useResolvedSchema useResponseExamples useSchemaUtils useServer useState useStf useSyncExternalStore useTheme useTranslations userCode user_code username users using v value valueSchema values variable variables variant variants verification verificationUri verificationUriComplete verification_uri verifier via view viewportClassName viewportProps views virtual void w-(--active-tab-width) w-6 w-7 w-72 w-[min(26rem,calc(100vw-2rem))] w-auto w-fit w-full w-max warn warning warns was we webhook webhooks what when where which while whitespace-pre whitespace-pre-wrap whole whose why width widths will window with without would wrap wrap-anywhere wrap-break-word wrapping write writeOnly written x-exclusiveCodeSample x-playground-lazy xml yellow yet your z-0 z-10 z-50");
1
+ @source inline("!collapsed !headers !isSecret !readOnly !renderBodyField !required !returned *:flex-1 *:justify-center *:min-w-0 --accordion-panel-height --active-tab-height --active-tab-left --active-tab-top --active-tab-width --anchor-width --available-height --collapsible-panel-height --fd-docs-height --fd-docs-row-3 --spacing --transform-origin -me-3 -mode -ms-0.5 -ms-2 -mt-1 -my-1 -z-1 @4xl:flex @4xl:flex-col @4xl:flex-row @4xl:items-start @4xl:max-h-[calc(var(--fd-docs-height,100dvh)-var(--fd-docs-row-3,0px)-2rem)] @4xl:sticky @4xl:top-[calc(var(--fd-docs-row-3,0px)+1rem)] @4xl:w-[400px] @container @default @defaultValue @deprecated @fuma-translate/react @fumadocs/json-schema @fumari/stf @max-sm:bg-fd-secondary/50 @max-sm:border @max-sm:mx-4 @max-sm:overflow-hidden @max-sm:pb-1.5 @max-sm:pb-3 @max-sm:pt-2 @max-sm:rounded-lg @max-xl:basis-full @max-xl:border-t @max-xl:flex-1 @max-xl:ps-1.5 @md:block @param @returns @scalar/api-client-react @see @sm:border-s @sm:flex @sm:grid-cols-[minmax(9rem,1fr)_minmax(0,2fr)] @sm:min-h-10 @sm:min-w-0 @xl:w-40 [&>div:has(>figcaption)]:h-10 [&[hidden]:not([hidden='until-found'])]:hidden [&_a]:underline [&_code]:font-mono [&_figcaption]:font-medium [&_figcaption]:overflow-visible [&_figcaption]:text-[0.8125rem] [&_figcaption]:text-fd-foreground [&_figcaption]:text-xs [&_svg]:size-3 [&_svg]:size-3.5 [--fd-docs-row-3:0px] [grid-area:1/1] [scrollbar-width:none] a abort about above absolute accept access access_token accordion accordions across action actions active:scale-[0.97] activity actual adapter adapters add addLogEntry added adding additional additionalProperties adds after again against alias align aligns all allOf allow allowCopy allowJson allowed already also alt among an anchor anchorSegments and animate-spin animates another any anyFields anyOf apiExample apiKey apiPlayground appearance-none application/javascript application/json application/x-javascript application/x-www-form-urlencoded application/xml applied applies apply are aren aria-checked aria-current aria-expanded aria-expanded:bg-fd-accent aria-expanded:decoration-solid aria-expanded:text-fd-accent-foreground aria-hidden aria-label aria-live aria-pressed arkdown array arrow arrows as aside async at audience auth authNode authProviders authSchemes authenticate authorization authorizationCode authorizationUrl authorization_code authorization_pending authorization_url authorize authorized authorizes auto-cols-[minmax(0,max-content)] autoComplete available avoid await away back backdrop-blur-[1px] backdrop-blur-xs badgeVariants bar base basic basis-full be bearer before behavior below beside between bg-amber-500 bg-amber-500/10 bg-black/40 bg-blue-500 bg-current/10 bg-fd-accent bg-fd-background bg-fd-card bg-fd-card/70 bg-fd-muted bg-fd-muted-foreground bg-fd-muted-foreground/50 bg-fd-popover bg-fd-primary bg-fd-primary/10 bg-fd-secondary bg-green-500 bg-linear-to-b bg-linear-to-t bg-red-500 bg-transparent binary block blocked blocks blue body bodyMediaType bodyNode bodyUrlRef boolean border border-0 border-b border-b-0 border-current border-dashed border-fd-border/60 border-fd-muted-foreground/50 border-fd-primary border-s border-t border-x-0 bottom bottom-0 box box-content breadcrumbs break-all browser browsers built-in builtinAuthProviders builtinProviders bundled busy but button buttonVariants buttons by bytes cache cached cachedDocFiles callbacks callbacksNode came can cancel cancelled candidates cannot caption captionCodeBlock captioned card cardCodeBlock cards case catch cause cell center certificate ch challenge change changes changing charset check checkbox checked chevron chevronClassName children chosen class class-variance-authority className cleanup clear clearResponse click clicking client client-rendered clientAuth clientCredentials clientId clientSecret clientWidth client_auth client_credentials client_error client_id client_secret clients cloned close closeDelay closed closest cn code codeProps codeUsages code_challenge code_challenge_method code_verifier codeblock col-span-2 col-span-full col-start-2 collapse collapses color colors column come component components compute confidential config configUrl configuration configurations connecting connection const constraints consumers container content contentTypes contents control controller controllerRef controls cookie cookieString cookies copies copy copyable copying core could count covered covers createContext createOAuthHandler createOpenAPIPage createOpenAPIPageBase createProxy created credentials cross-origin crumbClassName crumbs css csv ctions ctx current currentValue cursor-help cursor-pointer cursor-text custom customise customization cyan dark dark-mode dark:bg-fd-accent dark:text-amber-400 dark:text-blue-400 dark:text-cyan-400 dark:text-green-400 dark:text-orange-400 dark:text-red-400 dark:text-yellow-400 data data-[disabled]:opacity-50 data-[disabled]:pointer-events-none data-[highlighted]:bg-fd-accent data-[highlighted]:text-fd-accent-foreground data-active:text-fd-foreground data-checked data-checked:bg-fd-primary data-checked:bg-fd-primary-foreground data-checked:text-fd-accent-foreground data-checked:translate-x-3 data-empty:hidden data-ending-style:duration-150 data-ending-style:h-0 data-ending-style:opacity-0 data-ending-style:scale-95 data-ending-style:scale-[0.97] data-ending-style:scale-[0.98] data-highlighted:bg-fd-accent data-highlighted:text-fd-accent-foreground data-json-editor data-placeholder:text-fd-muted-foreground data-popup-open:bg-fd-accent data-popup-open:text-fd-accent-foreground data-popup-open:underline data-starting-style:h-0 data-starting-style:opacity-0 data-starting-style:scale-95 data-starting-style:scale-[0.98] data-type dataEngine decimal declare decode decoration-dotted default defaultColor defaultMdxComponents defaultShikiFactory defaultShikiOptions defaultValue defaultValues defaults define definitions delay delay-150 delete deprecated depth dereference dereferenced described describes description descriptionNode descriptions detail details device deviceAuthorization deviceAuthorizationUrl device_authorization_url device_code devices dialog didn direction directories disable disableCache disabled disabled:cursor-not-allowed disabled:opacity-50 disabled:opacity-80 discovered discovering display displayNames disposition div doc docCache docFilesCache docRoot docs document documents does doesn domain don download downloaded drives drop duplicated duration duration-150 duration-200 duration-250 duration-300 dynamic dynamicSource e each eading early ease-[cubic-bezier(0.16,1,0.3,1)] ease-[cubic-bezier(0.22,1,0.36,1)] ease-out edge edit edited editing editor edits element elements else empty enabled encode encodeRequestData end ending endpoint endpoints ends enforce engine enter entered entries entry enum err error error_description errors eslint-disable-next-line even every example exampleCardClassName exampleCodeBlock examples exclusiveMax exclusiveMin expand expanded expands expected expiresAt expires_in export exported expressions extended extends fades failed fallback false fast-content-type-parse fd-page-tree-item-name fd-scroll-container fetch fetchOptions fetcher field field-sizing-content fieldData fieldName fields file fileName files fill-current filled filling fills filter filterable finally finishes finishing first first:border-t-0 first:mt-0 fixed flattened flex flex-1 flex-col flex-col-reverse flex-row flex-wrap flow flow-root flowInfo flowReturned flows flushSync focus-visible:bg-fd-accent focus-visible:bg-fd-accent/40 focus-visible:bg-fd-primary/15 focus-visible:bg-fd-secondary focus-visible:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-fd-primary/30 focus-visible:ring-fd-ring focus-visible:ring-inset focus-visible:text-fd-accent-foreground focus-within:ring-1 focus-within:ring-fd-ring focus:outline-hidden focus:ring focus:ring-0 focus:ring-fd-ring follow font-light font-medium font-mono font-normal font-sans font-semibold for form form-encoded format forward fragment frameworks from from-fd-popover full fumadocs-core/highlight fumadocs-core/source fumadocs-core/toc fumadocs-openapi-flow fumadocs-openapi-oauth fumadocs-openapi-oauth-returned fumadocs-ui/mdx fumadocs:openapi fumadocs_openapi_requests function gap-0.5 gap-1 gap-1.5 gap-2 gap-2.5 gap-24 gap-3 gap-4 gap-x-2 gap-x-3 gap-x-6 gap-y-1 gap-y-4 generate generateDefault generateSchemaUI generateTypeScriptDefinitions generated generators get getLink getOpenAPIPageProps getPageProps getPreferredType getRaw getSchema getSchemas getState gets ghost github-dark github-light given gives go goes going grant_type grant_types_supported grants gray green grid grid-cols-[auto_minmax(0,1fr)] grid-cols-[auto_minmax(0,1fr)_auto] grid-cols-[minmax(0,1fr)_auto] grid-cols-[minmax(0,2fr)_minmax(0,3fr)] grid-flow-col grid-rows-[auto_minmax(0,1fr)] group group-data-[panel-open]/accordion:rotate-90 group-data-popup-open:rotate-180 group-hover/nav:translate-x-0.5 group-hover/open:translate-x-0.5 group-hover/property:opacity-100 group-hover:translate-x-0.5 group-hover:translate-x-px group/accordion group/nav group/open group/property group/row h-(--accordion-panel-height) h-(--active-tab-height) h-(--collapsible-panel-height) h-10 h-12 h-4 h-6 h-7 h-8 h-9 h-[calc(--spacing(10)-1px)] h-full h-px h1 handle handled handles happens has has-focus-visible:bg-fd-secondary hasVariables hash have headNode header headerRef headers heading headingLevel headless here hidden hiddenKeys highlighted highlighter highlights hint holding hook hour hour12 hover hover:bg-fd-accent hover:bg-fd-accent/40 hover:bg-fd-accent/50 hover:bg-fd-primary/15 hover:text-fd-accent-foreground hover:underline how href html htmlFor http i icon icon-sm icon-xs iconButtonClassName id idx if img implicit import imports in includeDocument including index indicator info infoTags init initAuth initial inline inline-flex input inputMode inputs inset-0 inset-x-0 inside installed instanceof instead integer interface interval into invalid invisible is isCopied isDynamic isExpanded isHighlighted isLazy isLoading isMac isNumber isSecret isSending isn issues it item itemSchema itemToStringValue items items-baseline items-center items-start items-stretch its itself js json json-schema-typed justify-between justify-center justify-end k kB keep keeps kept key keyboard keyed keyof keys kind label labelled lang language languages larger last last:border-b-0 last:shrink-0 lasts latest layout layouts lazy leading-5 leading-[1.375rem] leading-relaxed leave leaving left left-0 length let light light-mode like line line-clamp-3 line-through link links list listed listener listeners literal live load loadDocument loaded loaderPlugin loading loads location lock locked log long longer looks lowercase lucide-react make malformed many map mapValues margin margins marked masked match matches matching max max-age max-h-(--available-height) max-h-[min(18rem,30vh)] max-h-[min(var(--available-height),20rem)] max-h-none max-md:hidden max-w-1/2 max-w-40 max-w-60 max-w-64 max-w-72 max-w-80 max-w-[calc(100vw-2rem)] max-w-full maxEntries may mb-3 mb-4 md md:border-s md:grid-cols-[minmax(0,11fr)_minmax(0,9fr)] md:hidden me-1 me-2 me-auto measure measured measures media mediaAdapters mediaType member members memoized menu menuItems merge message messages metaData metaKey method methods milliseconds mime min min-h-0 min-h-10 min-h-11 min-h-60 min-h-9 min-h-full min-w-0 min-w-16 min-w-40 min-w-[calc(var(--anchor-width)+--spacing(2))] minute mode more motion motion-reduce:transition-none motion-reduce:transition-opacity motion-safe:-translate-x-6 motion-safe:animate-pulse motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0.16,1,0.3,1)] motion-safe:starting:-translate-x-2 motion-safe:starting:-translate-x-6 motion-safe:starting:-translate-y-4 motion-safe:starting:opacity-0 motion-safe:starting:scale-0 motion-safe:starting:scale-150 motion-safe:starting:translate-x-2 motion-safe:starting:translate-x-6 motion-safe:starting:translate-y-1 motion-safe:starting:translate-y-4 motion-safe:transition-[opacity,translate] motion-safe:transition-opacity motion-safe:transition-transform motionClassNames mounts move moves ms ms-1 ms-1.5 ms-auto mt-0! mt-0.5 mt-1 mt-1.5 mt-10 mt-2.5 mt-px multi-type multipart/form-data multiple must muted mutual mutualTLS mx-3 mx-px my-0! my-1 my-3 name name! nameClassName named names namespace narrow nav navigate navigated navigator nearest needs nested network never new next next/previous nextId no no-cache noValidate node noreferrer normalizes not not-first:border-s not-prose note now null number oauth oauth2 oauthRedirectUrl object objectGet objects observer obtain of off ok older omit omitted on onAppend onAuthorize onBack onCancel onChange onCheckedChange onClear onClick onCopy onKeyDown onLink onNavigate onOpenChange onRemove onReset onReturn onRoot onSelect onSubmit onUserCode onValueChange once one oneOf ones only opacity-0 opacity-60 opacity-80 open openApiData openIdConnect openIdConnectUrl openNested openOnHover openOnInputClick openapi openapiMeta opened opening opens operation optional options or orange origin origin-(--transform-origin) other others otherwise out outline-hidden output outside over overflow-auto overflow-clip overflow-hidden overflow-x-auto overflow-y-auto override overview own p-0.5 p-1 p-1.5 p-2 p-2.5 p-3 p-4 p-5 p-6 packages padding page pageData pages panel panelCodeBlock panelKey panelTopCodeBlock panels param parameter parameterLabel parameterNode parameters params parent parentIndex parents parse parsed parts party pass password paste patch path pathItem pathnameFromRequest pattern patternProperties payload pb-1 pb-2 pb-2.5 pb-3 pe-1 pe-1.5 pe-2 pe-3 pe-4 pendingFlowKey per persisted pill place placed placeholder placeholder:font-sans placeholder:text-fd-muted-foreground placeholder:text-fd-muted-foreground/70 placeholder:text-fd-primary/50 plain playground playgrounds please plugins pointer-coarse:opacity-100 polite poll polling popover pops popup port position postForm pre preferred prefers preloadOpenAPIPage preloaded presents prev preventDefault preview previous primary primitive private processor prop properties property props prose prose-no-margin prose-sm prose-xs provider providers proxied proxy proxyForwardCookie proxyUrl ps-1 ps-1.5 ps-3 ps-3.5 ps-4 ps-6 pt-1.5 pt-2 pt-2.5 public px-1 px-1.5 px-2 px-2.5 px-3 px-4 py-0 py-0.5 py-1 py-1.5 py-2 py-2.5 py-3 py-6 py-8 q query querySelector quiet random range raw reach react react-dom react-hooks/exhaustive-deps read read-only readOnly readers readonly reads received record red redirect redirectUrl redirect_uri redirected redirects ref reference refs regenerated rejected rejects rel relative reloading remark remark-rehype remarkGfm remarkRehype remembered remounted removable removal remove removeItem removed render renderAPIExampleUsageTabs renderBodyField renderCodeblock renderDefault renderMarkdown renderParameterField rendered renderers renders replace replaces represents request request-body requestBody requestData requestInit requestTimeout requestUrl requested requesting requests required requirement requirements res reset resize-none resized resolve resolveMediaAdapter resolveUrl resolved resolvedInput resolvedTheme resolves respond response response-body responseNode responseTabs response_type responses rest restore restored result return returned returnedFlow returnedScheme returnedUrl returning returns reversed revoked right ring-1 ring-3 ring-fd-border ring-green-500/20 role room root rootId rootRef rounded-[5px] rounded-full rounded-lg rounded-md rounded-none rounded-sm rounded-xl route row row-span-2 row-start-1 row-start-2 rowButtonClassName rows run runtime s safeParse same sample satisfies says scalar scan schema schemaId schemaKeys schemaUI schemas scheme schemeId schemes scope scopeOptions scopes scopes_supported screen screens scroll scroll-m-20 scroll-mt-[calc(var(--fd-docs-row-3,0px)+1rem)] scrollArrowClassName scrollMarginClassName scrolling search second secondary seconds secret secretSchema secrets section sectionIcons sectionNames sections security securitySchemes see segment segmentClassName segments segs select select-all select-none selectExample selectable selected selectedCodeUsages selectedType selecting selection selector selectors selects self-center self-stretch send sender sending sends sent server server-to-server serverSchema serverUrl servers services session sessionStorage set setAuthorizing setClientAuth setCode setCollapsed setDraft setFilter setIndex setInfo setMode setMotion setName setOpen setResponse setScopes setSelected setSelectedFor setSending setServerVariables setShowSchema setStack setType setUserCode setValue setView several shadow-lg shadow-md shadow-none shadow-sm share shared shared-api/auto-anchor shared-api/source shiki shikiOptions shortcut shorten show showDescription showExample showResponseSchema showTitle shown shows shrink shrink-0 shrinks sibling siblings side sideOffset signal signing single sits size size-2 size-3 size-3.5 size-4 size-5 skipNonRequired skipReadOnly slashes slides sliding slots slow_down sm sm:-translate-x-1/2 sm:-translate-y-1/2 sm:border sm:h-[min(52rem,calc(100dvh-3rem))] sm:inline sm:inset-auto sm:left-1/2 sm:max-h-[min(52rem,calc(100dvh-3rem))] sm:mb-4 sm:mx-4 sm:ps-5 sm:px-4 sm:rounded-2xl sm:shadow-2xl sm:top-1/2 sm:w-[min(64rem,calc(100vw-3rem))] sm:w-[min(80rem,calc(100vw-3rem))] small smaller smooth so some something space spellCheck sr-only src stable stack start started starting starting:opacity-0 starts state staticSource status statusInfo stay stays step stf sticky still stops storage storageKey storageKeyPrefix store stored string stringifyFieldKey structuredData style styles submit subscribe subscribeNever successful such suggestions summary suspends svg switch switches switching sync syncExample synced t tPlayground tab tabIndex tabs tabular-nums tag tagClassName taken takes target telling text text-4xl text-[0.8125rem] text-amber-600 text-blue-600 text-center text-cyan-600 text-fd-accent-foreground text-fd-card-foreground text-fd-foreground text-fd-muted-foreground text-fd-muted-foreground/60 text-fd-muted-foreground/70 text-fd-popover-foreground text-fd-primary text-fd-primary-foreground text-fd-secondary-foreground text-green-600 text-nowrap text-orange-600 text-red-400 text-red-600 text-sm text-start text-xl text-xs text-yellow-600 text/css text/csv text/html text/plain textarea[data-json-editor]:invalid texts than that the their them themes then there they this three through throw time timeFormat timeout timer timerRef tips title titleBarClassName tls to to-transparent toStaticData toVirtualFiles toc toggle toggled token tokenUrl token_type token_url top top-(--active-tab-top) top-0 total tracking-tight tracking-widest transform transformPageTree transition-[background-color,scale] transition-[height,opacity] transition-[height] transition-[opacity,scale] transition-[translate,background-color] transition-[translate,width] transition-colors transition-opacity transition-shadow transition-transform transitionClassName translate-x-(--active-tab-left) translations trigger true truncate truncating try turns type typeClassName typeof types typing undefined under underline underline-offset-4 undici union unionField unions unique unit unknown unless unset unsetting until up update updateInfo updated updating upper url urn:ietf:params:oauth:grant-type:device_code usage usageTabs usages use useAnchorId useAnchorLink useApiClient useComponents useCopyButton useDataEngine useEffect useFieldValue useListener useMemo useNamespace useOnChange useOpenAPI useOperation useQuery useRef useRenderContext useResolvedSchema useResponseExamples useSchemaUtils useServer useState useStf useSyncExternalStore useTheme useTranslations userCode user_code username users using v valid value valueSchema values variable variables variant variants verification verificationUri verificationUriComplete verification_uri verifier via view viewportClassName viewportProps views virtual void w-(--active-tab-width) w-6 w-7 w-72 w-[min(26rem,calc(100vw-2rem))] w-auto w-fit w-full w-max warn warning warns was we webhook webhooks what when where which while whitespace-pre whitespace-pre-wrap whole whose why width widths will window with without would wrap wrap-anywhere wrap-break-word wrapping write writeOnly written x-exclusiveCodeSample x-playground-lazy xml yellow yet your z-0 z-10 z-50");
package/dist/operation.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { idToTitle } from "./packages/shared-api/dist/utils/id-to-title.js";
3
2
  import { joinURL } from "./packages/shared-api/dist/utils/url.js";
4
3
  import { createCodeUsageGeneratorRegistry, pathnameFromRequest } from "./requests/generators/index.js";
5
4
  import { encodeRequestData } from "./requests/media/encode.js";
6
- import { getExampleValue, getPreferredType, methodKeys } from "./utils/schema.js";
5
+ import { getExampleValue, getOperationTitle, getPreferredType, methodKeys } from "./utils/schema.js";
7
6
  import { getExampleRequests } from "./utils/get-example-requests.js";
8
- import { useOpenAPI } from "./utils/create-page.js";
7
+ import { useOpenAPI, useRenderContext } from "./utils/create-page.js";
8
+ import { getDefaultAuth } from "./playground/auth.js";
9
9
  import { ServerProvider, useServer } from "./utils/use-server.js";
10
10
  import { createContext, use, useMemo, useSyncExternalStore } from "react";
11
11
  import { getRaw } from "@scalar/json-magic/magic-proxy";
@@ -33,6 +33,7 @@ function resolveMedia(media) {
33
33
  }
34
34
  function OperationProvider({ type = "operation", path, method, operation, pathItem, children }) {
35
35
  const runtime = useOpenAPI();
36
+ const { playground } = useRenderContext();
36
37
  const state = useMemo(() => {
37
38
  const { dereferenced, resolve } = runtime.doc;
38
39
  const body = resolve(operation.requestBody);
@@ -117,7 +118,12 @@ function OperationProvider({ type = "operation", path, method, operation, pathIt
117
118
  method,
118
119
  requestBody,
119
120
  parameters: resolvedParameters,
120
- mediaAdapters: runtime.mediaAdapters
121
+ mediaAdapters: runtime.mediaAdapters,
122
+ auth: type === "operation" ? getDefaultAuth(runtime, {
123
+ operation,
124
+ providers: playground?.authProviders,
125
+ transform: playground?.transformAuthInputs
126
+ }) : void 0
121
127
  });
122
128
  for (const item of examples) item.pathname = pathnameFromRequest(path, item.encoded);
123
129
  return {
@@ -127,7 +133,7 @@ function OperationProvider({ type = "operation", path, method, operation, pathIt
127
133
  method,
128
134
  operation,
129
135
  pathItem,
130
- title: operation.summary || pathItem.summary || (operation.operationId ? idToTitle(operation.operationId) : path),
136
+ title: getOperationTitle(operation, pathItem, path),
131
137
  description: operation.description ?? pathItem.description,
132
138
  requestBody,
133
139
  parameters,
@@ -142,6 +148,7 @@ function OperationProvider({ type = "operation", path, method, operation, pathIt
142
148
  };
143
149
  }, [
144
150
  runtime,
151
+ playground,
145
152
  type,
146
153
  path,
147
154
  method,
@@ -6,13 +6,13 @@ import { Fragment, useId, useMemo, useState } from "react";
6
6
  import { dereference, matches, matchesType, mergeAllOf, stringify } from "@fumadocs/json-schema";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
8
  import { useTranslations } from "@fuma-translate/react";
9
+ import { useArray, useDataEngine, useFieldValue, useObject } from "@fumari/stf";
10
+ import { isPlainObject, stringifyFieldKey } from "@fumari/stf/lib/utils";
9
11
  import { Check, ChevronDown, ChevronRight, ChevronsUpDown, Copy, Plus, Trash2, Upload, X } from "lucide-react";
10
12
  import { Select } from "@base-ui/react/select";
11
13
  import { buttonVariants } from "fumadocs-ui/components/ui/button";
12
14
  import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
13
15
  import { flushSync } from "react-dom";
14
- import { useArray, useDataEngine, useFieldValue, useObject } from "@fumari/stf";
15
- import { isPlainObject, stringifyFieldKey } from "@fumari/stf/lib/utils";
16
16
  import { Autocomplete } from "@base-ui/react/autocomplete";
17
17
  import { Popover } from "@base-ui/react/popover";
18
18
  // ../shared-api/dist/components/playground/fields.js
@@ -20,6 +20,8 @@ function JsonEditor({ fieldName }) {
20
20
  className: "flex flex-col",
21
21
  children: [/* @__PURE__ */ jsx("textarea", {
22
22
  "aria-label": "JSON",
23
+ "data-json-editor": "",
24
+ ref: (el) => el?.setCustomValidity(draft.error),
23
25
  value: draft.text,
24
26
  spellCheck: false,
25
27
  onChange: (e) => {
@@ -9,10 +9,10 @@ import { cn } from "../../utils/cn.js";
9
9
  import { memo, useState } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import { useTranslations } from "@fuma-translate/react";
12
- import { ArrowLeft, ChevronRight, SendHorizontal } from "lucide-react";
13
- import { buttonVariants } from "fumadocs-ui/components/ui/button";
14
12
  import { useDataEngine } from "@fumari/stf";
15
13
  import { stringifyFieldKey } from "@fumari/stf/lib/utils";
14
+ import { ArrowLeft, ChevronRight, SendHorizontal } from "lucide-react";
15
+ import { buttonVariants } from "fumadocs-ui/components/ui/button";
16
16
  // ../shared-api/dist/components/playground/panels.js
17
17
  const motionClassNames = {
18
18
  forward: "motion-safe:starting:translate-x-6",
@@ -4,8 +4,8 @@ import { cn } from "../../utils/cn.js";
4
4
  import { useEffect, useRef, useState } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { useTranslations } from "@fuma-translate/react";
7
- import { Check, ChevronDown } from "lucide-react";
8
7
  import { StfProvider, useFieldValue, useListener, useStf } from "@fumari/stf";
8
+ import { Check, ChevronDown } from "lucide-react";
9
9
  import { Popover } from "@base-ui/react/popover";
10
10
  // ../shared-api/dist/components/playground/server-select.js
11
11
  /**
@@ -354,6 +354,7 @@ function ObjectProperty({ id, name, $type, required = false, parentIndex, action
354
354
  }),
355
355
  schema.type === "primitive" ? /* @__PURE__ */ jsx("span", {
356
356
  className: typeClassName,
357
+ "data-type": schema.primitive,
357
358
  children: schema.aliasName
358
359
  }) : /* @__PURE__ */ jsx(TypeInfo, {
359
360
  name,
@@ -394,10 +395,12 @@ function TypeInfo({ name, $ref, children }) {
394
395
  const schema = refs[$ref];
395
396
  if (schema.type === "primitive" && !schema.description && !schema.infoTags?.length) return /* @__PURE__ */ jsx("span", {
396
397
  className: typeClassName,
398
+ "data-type": schema.primitive,
397
399
  children
398
400
  });
399
401
  if (schema.type === "and" || schema.type === "or") return /* @__PURE__ */ jsx("span", {
400
402
  className: cn(typeClassName, "flex flex-wrap items-center gap-1.5"),
403
+ "data-type": schema.type,
401
404
  children: schema.items.map((item, i) => /* @__PURE__ */ jsxs(Fragment, { children: [i > 0 && (schema.type === "and" ? "&" : "|"), /* @__PURE__ */ jsx(TypeInfo, {
402
405
  name,
403
406
  $ref: item.$type,
@@ -406,6 +409,7 @@ function TypeInfo({ name, $ref, children }) {
406
409
  });
407
410
  if (schema.type === "array") return /* @__PURE__ */ jsxs("span", {
408
411
  className: cn(typeClassName, "flex flex-wrap items-center"),
412
+ "data-type": "array",
409
413
  children: [
410
414
  "array<",
411
415
  /* @__PURE__ */ jsx(TypeInfo, {
@@ -420,6 +424,7 @@ function TypeInfo({ name, $ref, children }) {
420
424
  type: "button",
421
425
  "aria-expanded": isExpanded?.(name, $ref),
422
426
  onClick: () => open(name, $ref),
427
+ "data-type": schema.type === "primitive" ? schema.primitive : schema.type,
423
428
  className: cn(typeClassName, "text-start underline decoration-dotted underline-offset-4 transition-colors hover:text-fd-accent-foreground aria-expanded:text-fd-accent-foreground aria-expanded:decoration-solid"),
424
429
  children
425
430
  });
@@ -1,3 +1,4 @@
1
+ import "../utils/create-page.js";
1
2
  import { OAuthFlows, OperationObject, SecuritySchemeObject } from "../types.js";
2
3
  import { RawRequestData } from "../requests/types.js";
3
4
  import { FC, ReactNode } from "react";
@@ -427,56 +427,72 @@ function getAuthScheme(scheme) {
427
427
  if (scheme.type !== "http" || !scheme.scheme) return "Bearer";
428
428
  return `${scheme.scheme[0].toUpperCase()}${scheme.scheme.slice(1)}`;
429
429
  }
430
+ /** the security requirements of an operation, and the one selected first */
431
+ function getRequirements({ dereferenced, resolve }, operation) {
432
+ const requirements = [];
433
+ const schemes = dereferenced.components?.securitySchemes ?? {};
434
+ for (const map of operation?.security ?? dereferenced.security ?? []) {
435
+ const list = [];
436
+ for (const [id, scopes] of Object.entries(map)) {
437
+ const scheme = resolve(schemes[id]);
438
+ if (scheme) list.push({
439
+ id,
440
+ scopes,
441
+ scheme
442
+ });
443
+ }
444
+ if (list.length > 0) requirements.push(list);
445
+ }
446
+ const idx = requirements.findIndex((req) => req.every((item) => !item.scheme.deprecated));
447
+ return {
448
+ requirements,
449
+ selected: idx === -1 && requirements.length > 0 ? 0 : idx
450
+ };
451
+ }
452
+ function createAuthFields(requirement, storageKeyPrefix, { providers, transform }) {
453
+ if (!requirement) return [];
454
+ const out = requirement.map((item) => ({
455
+ schemeId: item.id,
456
+ scheme: item.scheme,
457
+ scopes: item.scopes,
458
+ fieldName: ["auth", item.id],
459
+ storageKey: `${storageKeyPrefix}auth-${item.id}`,
460
+ defaultValue: getDefaultValue(item.scheme),
461
+ provider: findProvider(providers, item)
462
+ }));
463
+ return transform ? transform(out) : out;
464
+ }
465
+ /** replace the values with `********`, for code usages */
466
+ function mask(value) {
467
+ if (value === void 0) return value;
468
+ return JSON.parse(JSON.stringify(value), (_, v) => typeof v === "string" && v ? "********" : v);
469
+ }
470
+ /**
471
+ * Encode the default values of the auth fields into request data like code usages, what playgrounds start with.
472
+ */
473
+ function getDefaultAuth({ doc, storageKeyPrefix }, options) {
474
+ const { requirements, selected } = getRequirements(doc, options.operation);
475
+ const fields = createAuthFields(requirements[selected], storageKeyPrefix, options);
476
+ return (data) => {
477
+ const out = structuredClone(data);
478
+ for (const field of fields) field.provider.onRequest(out, mask(field.defaultValue), field);
479
+ return out;
480
+ };
481
+ }
430
482
  /**
431
483
  * The auth fields of an API playground: the values it persists, and the request data they encode into.
432
484
  */
433
485
  function useAuthFields(engine, { operation, providers, transform } = {}) {
434
486
  const page = usePlaygroundAuth().stf.dataEngine;
435
487
  const { storageKeyPrefix, doc } = useOpenAPI();
436
- const { dereferenced, resolve } = doc;
437
- const schemes = dereferenced.components?.securitySchemes;
438
- const requirements = useMemo(() => {
439
- const out = [];
440
- if (!schemes) return out;
441
- for (const map of operation?.security ?? dereferenced.security ?? []) {
442
- const list = [];
443
- for (const [id, scopes] of Object.entries(map)) {
444
- const scheme = resolve(schemes[id]);
445
- if (scheme) list.push({
446
- id,
447
- scopes,
448
- scheme
449
- });
450
- }
451
- if (list.length > 0) out.push(list);
452
- }
453
- return out;
454
- }, [
455
- dereferenced.security,
456
- operation?.security,
457
- resolve,
458
- schemes
459
- ]);
460
- const [selected, select] = useState(() => {
461
- if (requirements.length === 0) return -1;
462
- const idx = requirements.findIndex((req) => req.every((item) => !item.scheme.deprecated));
463
- return idx !== -1 ? idx : 0;
464
- });
465
- const requirement = selected === -1 ? null : requirements[selected];
466
- const fields = useMemo(() => {
467
- if (!requirement) return [];
468
- const out = requirement.map((item) => ({
469
- schemeId: item.id,
470
- scheme: item.scheme,
471
- scopes: item.scopes,
472
- fieldName: ["auth", item.id],
473
- storageKey: `${storageKeyPrefix}auth-${item.id}`,
474
- defaultValue: getDefaultValue(item.scheme),
475
- provider: findProvider(providers, item)
476
- }));
477
- return transform ? transform(out) : out;
478
- }, [
479
- requirement,
488
+ const { requirements, selected: initial } = useMemo(() => getRequirements(doc, operation), [doc, operation]);
489
+ const [selected, select] = useState(initial);
490
+ const fields = useMemo(() => createAuthFields(requirements[selected], storageKeyPrefix, {
491
+ providers,
492
+ transform
493
+ }), [
494
+ requirements,
495
+ selected,
480
496
  storageKeyPrefix,
481
497
  providers,
482
498
  transform
@@ -502,7 +518,7 @@ function useAuthFields(engine, { operation, providers, transform } = {}) {
502
518
  const auth = page.get(["auth"]) ?? {};
503
519
  const cloned = structuredClone({
504
520
  ...values,
505
- auth: masked ? JSON.parse(JSON.stringify(auth), (_, v) => typeof v === "string" && v ? "********" : v) : auth
521
+ auth: masked ? mask(auth) : auth
506
522
  });
507
523
  const data = cloned;
508
524
  for (const field of fields) field.provider.onRequest(data, objectGet(data, field.fieldName), field);
@@ -522,4 +538,4 @@ function useAuthFields(engine, { operation, providers, transform } = {}) {
522
538
  }, [page, fields])
523
539
  };
524
540
  }
525
- export { finishOAuthFlow, requestOAuthToken, useAuthFields, useAuthRedirect, useOpenIdConnectFlows, usePlaygroundAuth };
541
+ export { finishOAuthFlow, getDefaultAuth, requestOAuthToken, useAuthFields, useAuthRedirect, useOpenIdConnectFlows, usePlaygroundAuth };
@@ -25,7 +25,7 @@ function createBrowserFetcher(adapters, { proxyUrl, proxyForwardCookie = true, r
25
25
  const param = data.header[key];
26
26
  headers.append(key, param.value);
27
27
  }
28
- if (data.bodyMediaType && data.body) {
28
+ if (data.bodyMediaType && data.body !== void 0) {
29
29
  const adapter = resolveMediaAdapter(data.bodyMediaType, adapters);
30
30
  if (!adapter) return {
31
31
  type: "client_error",
@@ -69,7 +69,7 @@ function usePlayground({ authProviders, transformAuthInputs, fetchOptions } = {}
69
69
  query: data?.query ?? {},
70
70
  header: data?.header ?? {},
71
71
  cookie: data?.cookie ?? {},
72
- body: data?.body ?? {}
72
+ body: data?.body === void 0 ? {} : data.body
73
73
  };
74
74
  }, [examples, selected]);
75
75
  const stf = useMemo(() => ({ dataEngine: new PlaygroundForm(defaultValues, page.stf.dataEngine) }), [defaultValues, page.stf.dataEngine]);
@@ -12,7 +12,7 @@ const curl = {
12
12
  for (const k in data.cookie) s.push(`--cookie ${shellQuote(`${k}=${data.cookie[k].value}`)}`);
13
13
  const type = data.bodyMediaType && resolveMediaType(data.bodyMediaType, mediaAdapters);
14
14
  if (data.body && type === "multipart/form-data") for (const [key, value] of formFields(data.body)) s.push(`-F ${shellQuote(`${key}=${value}`)}`);
15
- else if (data.body && type) {
15
+ else if (type && type !== "multipart/form-data" && data.body !== void 0) {
16
16
  s.push(`-H 'Content-Type: ${data.bodyMediaType}'`);
17
17
  s.push(`-d ${shellQuote(inputToString(data.body, type))}`);
18
18
  }
@@ -3,7 +3,7 @@ import { createCodeUsageGeneratorRegistry as createCodeUsageGeneratorRegistry$1
3
3
  function pathnameFromRequest(pathname, { path, query }) {
4
4
  for (const key in path) {
5
5
  const param = path[key];
6
- pathname = pathname.replace(`{${key}}`, param.value);
6
+ pathname = pathname.replaceAll(`{${key}}`, () => param.value);
7
7
  }
8
8
  const [pathPart, existingQueryString] = pathname.split("?", 2);
9
9
  const searchParams = new URLSearchParams(existingQueryString || "");
@@ -117,7 +117,7 @@ const defaultAdapters = {
117
117
  * Generate the code that inits a `body` variable for the request body, `undefined` when unsupported.
118
118
  */
119
119
  function generateBodyExample(data, adapters, ctx) {
120
- if (!data.body || !data.bodyMediaType) return;
120
+ if (data.body === void 0 || !data.bodyMediaType) return;
121
121
  return resolveMediaAdapter(data.bodyMediaType, adapters)?.generateExample(data, ctx);
122
122
  }
123
123
  function str(init, mediaType, ctx) {
@@ -3,10 +3,10 @@ import { require_js2xml } from "../node_modules/.pnpm/xml-js@1.6.11/node_modules
3
3
  // src/requests/string-utils.ts
4
4
  var import_js2xml = /* @__PURE__ */ __toESM(require_js2xml(), 1);
5
5
  /**
6
- * The text of a body value in the format of a media type, strings are already serialized.
6
+ * The text of a body value in the format of a media type. Non-JSON strings are already serialized.
7
7
  */
8
8
  function inputToString(value, format = "application/json") {
9
- if (typeof value === "string") return value;
9
+ if (typeof value === "string" && format !== "application/json") return value;
10
10
  if (format === "application/x-ndjson") return Array.isArray(value) ? value.map((v) => JSON.stringify(v)).join("\n") : JSON.stringify(value, null, 2);
11
11
  if (format === "application/x-www-form-urlencoded") return toSearchParams(value).toString();
12
12
  if (format === "application/xml") return (0, import_js2xml.default)(value, {
@@ -113,8 +113,9 @@ function OperationContent({ showTitle, showDescription, headingLevel = 2 }) {
113
113
  children: /* @__PURE__ */ jsx("div", {
114
114
  className: "rounded-xl border bg-fd-card px-3",
115
115
  children: items.map((param) => {
116
- if (param.schema == null) return;
117
- const schema = resolve(param.schema);
116
+ const raw = param.schema ?? resolve(Object.values(param.content ?? {})[0])?.schema;
117
+ if (raw == null) return;
118
+ const schema = resolve(raw);
118
119
  return /* @__PURE__ */ jsx(SchemaUI, {
119
120
  client: {
120
121
  name: param.name,
@@ -13,12 +13,13 @@ import { UrlBar } from "./components/url-bar.js";
13
13
  import { builtinAuthProviders } from "./components/auth.js";
14
14
  import { RequestPanel } from "./components/request-panel.js";
15
15
  import { ResponsePanel } from "./components/response-panel.js";
16
- import { useMemo, useState } from "react";
16
+ import { useMemo, useRef, useState } from "react";
17
17
  import { jsx, jsxs } from "react/jsx-runtime";
18
18
  import { useTranslations } from "@fuma-translate/react";
19
+ import { StfProvider, useFieldValue } from "@fumari/stf";
19
20
  import { X } from "lucide-react";
21
+ import { flushSync } from "react-dom";
20
22
  import { Dialog } from "@base-ui/react/dialog";
21
- import { StfProvider, useFieldValue } from "@fumari/stf";
22
23
  import { useOnChange } from "fumadocs-core/utils/use-on-change";
23
24
  // src/ui/playground/client.tsx
24
25
  function PlaygroundClient({ writeOnly = true, readOnly = false, authProviders, transformAuthInputs, fetchOptions, components, renderParameterField, renderBodyField, ...rest }) {
@@ -75,12 +76,21 @@ function PlaygroundDialog({ playground, renderParameterField, renderBodyField, R
75
76
  value: "response",
76
77
  label: t("Response")
77
78
  }], [t]);
79
+ const rootRef = useRef(null);
78
80
  const onSubmit = (e) => {
79
81
  e.preventDefault();
82
+ const invalid = rootRef.current?.querySelector("textarea[data-json-editor]:invalid");
83
+ if (invalid) {
84
+ flushSync(() => setView("request"));
85
+ invalid.focus();
86
+ invalid.reportValidity();
87
+ return;
88
+ }
80
89
  send();
81
90
  setView("response");
82
91
  };
83
92
  return /* @__PURE__ */ jsxs("div", {
93
+ ref: rootRef,
84
94
  className: "flex min-h-0 flex-1 flex-col",
85
95
  onKeyDown: (e) => {
86
96
  if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) onSubmit(e);
@@ -11,10 +11,10 @@ import { CheckRow, SelectRow, TextRow, ValueRow } from "../../../packages/shared
11
11
  import { Suspense, useEffect, useRef, useState } from "react";
12
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
13
  import { useTranslations } from "@fuma-translate/react";
14
+ import { StfProvider, useDataEngine, useStf } from "@fumari/stf";
14
15
  import { Check, Copy, ExternalLink, ShieldCheck } from "lucide-react";
15
16
  import { buttonVariants } from "fumadocs-ui/components/ui/button";
16
17
  import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
17
- import { StfProvider, useDataEngine, useStf } from "@fumari/stf";
18
18
  // src/ui/playground/components/auth.tsx
19
19
  /** the rows of OAuth and mutual TLS schemes in the built-in UI, after the providers of page */
20
20
  const builtinAuthProviders = [{
@@ -10,8 +10,8 @@ import { cn } from "../../../utils/cn.js";
10
10
  import { Fragment, createContext, use, useState } from "react";
11
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
12
  import { useTranslations } from "@fuma-translate/react";
13
- import { Braces, Cookie, KeyRound, PlusIcon, Route, Rows3, SlidersHorizontal } from "lucide-react";
14
13
  import { stringifyFieldKey } from "@fumari/stf/lib/utils";
14
+ import { Braces, Cookie, KeyRound, PlusIcon, Route, Rows3, SlidersHorizontal } from "lucide-react";
15
15
  // src/ui/playground/components/request-panel.tsx
16
16
  const sectionIcons = {
17
17
  path: Route,
@@ -3,7 +3,7 @@ import { getExampleValue, getPreferredType, pickExample } from "./schema.js";
3
3
  import { getRaw } from "@scalar/json-magic/magic-proxy";
4
4
  import { dereference, sample } from "@fumadocs/json-schema";
5
5
  // src/utils/get-example-requests.ts
6
- function getExampleRequests({ path, method, mediaAdapters, requestBody, parameters }) {
6
+ function getExampleRequests({ path, method, mediaAdapters, requestBody, parameters, auth = (data) => data }) {
7
7
  const media = requestBody?.content ? getPreferredType(requestBody.content) : null;
8
8
  const bodyOfType = media ? dereference(requestBody.content[media]) : null;
9
9
  if (bodyOfType?.examples) {
@@ -22,7 +22,7 @@ function getExampleRequests({ path, method, mediaAdapters, requestBody, paramete
22
22
  name: summary || key,
23
23
  description,
24
24
  data,
25
- encoded: encodeRequestData(data, mediaAdapters, parameters)
25
+ encoded: encodeRequestData(auth(data), mediaAdapters, parameters)
26
26
  });
27
27
  }
28
28
  if (result.length > 0) return result;
@@ -39,7 +39,7 @@ function getExampleRequests({ path, method, mediaAdapters, requestBody, paramete
39
39
  name: "Default",
40
40
  description: typeof schema === "object" ? schema.description : void 0,
41
41
  data,
42
- encoded: encodeRequestData(data, mediaAdapters, parameters)
42
+ encoded: encodeRequestData(auth(data), mediaAdapters, parameters)
43
43
  }];
44
44
  }
45
45
  function getRequestData({ method, path, parameters, sampleKey, body }) {
@@ -81,7 +81,7 @@ function getRequestData({ method, path, parameters, sampleKey, body }) {
81
81
  result.bodyMediaType = type;
82
82
  const bodyOfType = dereference(body.content[type]);
83
83
  if (bodyOfType.examples && sampleKey !== void 0) result.body = getExampleValue(dereference(bodyOfType.examples[sampleKey]));
84
- else if (bodyOfType.example) result.body = getRaw(bodyOfType.example);
84
+ else if (bodyOfType.example !== void 0) result.body = getRaw(bodyOfType.example);
85
85
  else result.body = sample(bodyOfType?.schema ?? {}, {
86
86
  skipReadOnly: true,
87
87
  skipNonRequired: true
@@ -18,7 +18,7 @@ function createAutoPreset(options) {
18
18
  return schemaId.startsWith("http://") || schemaId.startsWith("https://") ? "index" : path.basename(schemaId, path.extname(schemaId));
19
19
  }
20
20
  if (result.type === "operation") {
21
- const operation = this.document.paths[result.item.path][result.item.method];
21
+ const operation = dereference(this.document.paths[result.item.path])[result.item.method];
22
22
  if (algorithm === "v2" && operation.operationId) return operation.operationId;
23
23
  return path.join(this.routePathToFilePath(result.item.path), result.item.method.toLowerCase());
24
24
  }
@@ -1,5 +1,5 @@
1
- import { idToTitle } from "../../packages/shared-api/dist/utils/id-to-title.js";
2
1
  import { dereferenceBundledDocument } from "../document/dereference.js";
2
+ import { getOperationTitle } from "../schema.js";
3
3
  import { dereference } from "@fumadocs/json-schema";
4
4
  import Slugger from "github-slugger";
5
5
  // src/utils/pages/to-static-data.ts
@@ -11,9 +11,9 @@ function toStaticData(page, doc) {
11
11
  headings: [],
12
12
  contents: []
13
13
  };
14
- function pathItem(item, defaultTitle) {
15
- if (page.showTitle && item.operationId) {
16
- const title = item.summary || (item.operationId ? idToTitle(item.operationId) : defaultTitle);
14
+ function addOperation(item, pathItem, path) {
15
+ if (page.showTitle) {
16
+ const title = getOperationTitle(item, pathItem, path);
17
17
  const id = slugger.slug(title);
18
18
  toc.push({
19
19
  depth: 2,
@@ -31,14 +31,16 @@ function toStaticData(page, doc) {
31
31
  });
32
32
  }
33
33
  for (const item of page.operations ?? []) {
34
- const operation = dereference(proxied.paths?.[item.path])?.[item.method];
35
- if (!operation) continue;
36
- pathItem(operation, item.path);
34
+ const pathItem = dereference(proxied.paths?.[item.path]);
35
+ const operation = pathItem?.[item.method];
36
+ if (!pathItem || !operation) continue;
37
+ addOperation(operation, pathItem, item.path);
37
38
  }
38
39
  for (const item of page.webhooks ?? []) {
39
- const webhook = dereference(proxied.webhooks?.[item.name])?.[item.method];
40
- if (!webhook) continue;
41
- pathItem(webhook, item.name);
40
+ const pathItem = dereference(proxied.webhooks?.[item.name]);
41
+ const operation = pathItem?.[item.method];
42
+ if (!pathItem || !operation) continue;
43
+ addOperation(operation, pathItem, `/${item.name}`);
42
44
  }
43
45
  return {
44
46
  toc,
@@ -23,6 +23,9 @@ function getTagDisplayName(tag) {
23
23
  if (tag.summary) return tag.summary;
24
24
  return idToTitle(tag.name);
25
25
  }
26
+ function getOperationTitle(operation, pathItem, path) {
27
+ return operation.summary || pathItem.summary || (operation.operationId ? idToTitle(operation.operationId) : path);
28
+ }
26
29
  function pickExample(value) {
27
30
  if (value.example !== void 0) return getRaw(value.example);
28
31
  if (value.content) {
@@ -41,6 +44,6 @@ function pickExample(value) {
41
44
  }
42
45
  /** the value of an Example Object, `dataValue` since OpenAPI 3.2 */
43
46
  function getExampleValue(example) {
44
- return getRaw(example.dataValue ?? example.value);
47
+ return getRaw(example.dataValue !== void 0 ? example.dataValue : example.value);
45
48
  }
46
- export { getExampleValue, getPreferredType, getTagDisplayName, methodKeys, pickExample };
49
+ export { getExampleValue, getOperationTitle, getPreferredType, getTagDisplayName, methodKeys, pickExample };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-openapi",
3
- "version": "12.6.8",
3
+ "version": "12.6.10",
4
4
  "description": "Generate MDX docs for your OpenAPI spec",
5
5
  "keywords": [
6
6
  "Docs",
@@ -56,7 +56,7 @@
56
56
  "dependencies": {
57
57
  "@base-ui/react": "^1.9.0",
58
58
  "@fuma-translate/react": "^1.0.2",
59
- "@fumadocs/json-schema": "^0.3.6",
59
+ "@fumadocs/json-schema": "^0.3.7",
60
60
  "@fumari/json-schema-ts": "^1.0.2",
61
61
  "@fumari/stf": "^1.1.2",
62
62
  "@scalar/json-magic": "^0.19.0",
@@ -80,10 +80,10 @@
80
80
  "@types/react-dom": "^19.3.0",
81
81
  "fast-content-type-parse": "^4.0.1",
82
82
  "fuma-cli": "^0.3.4",
83
- "fumadocs-core": "16.19.8",
84
- "fumadocs-ui": "npm:@fumadocs/base-ui@16.19.8",
83
+ "fumadocs-core": "16.19.10",
84
+ "fumadocs-ui": "npm:@fumadocs/base-ui@16.19.10",
85
85
  "json-schema-typed": "^9.0.0",
86
- "shared-api": "0.2.17",
86
+ "shared-api": "0.2.18",
87
87
  "tsconfig": "0.0.0",
88
88
  "tsdown": "0.23.7",
89
89
  "xml-js": "^1.6.11"