UNPKG

@kubb/plugin-oas

Version:

OpenAPI Specification (OAS) plugin for Kubb, providing core functionality for parsing and processing OpenAPI/Swagger schemas for code generation.

17 lines (11 loc) 398 B
import { useContext } from '@kubb/react' import { Schema } from '../components/Schema.tsx' import type { SchemaContextProps } from '../components/Schema.tsx' type UseSchemaResult = SchemaContextProps /** * `useSchema` will return the current `schema properties` */ export function useSchema(): UseSchemaResult { const props = useContext(Schema.Context) return props as UseSchemaResult }