schema-display-nested.tsx 470 B

1234567891011121314151617181920212223
  1. "use client";
  2. import { SchemaDisplay } from "@/components/ai-elements/schema-display";
  3. const Example = () => (
  4. <SchemaDisplay
  5. method="POST"
  6. path="/api/posts"
  7. requestBody={[
  8. {
  9. name: "author",
  10. properties: [
  11. { name: "id", type: "string" },
  12. { name: "name", type: "string" },
  13. ],
  14. type: "object",
  15. },
  16. { name: "title", required: true, type: "string" },
  17. ]}
  18. />
  19. );
  20. export default Example;