{"repo":"deepankarm/godantic","free":true,"listed":false,"github":"https://github.com/deepankarm/godantic","clone":"git clone https://github.com/deepankarm/godantic.git","description":"Validation, JSON & OpenAPI Schema for Go with Union support. Inspired by Pydantic & FastAPI.","language":"Go","stars":29,"topics":["golang","jsonschema","llm","pydantic","structured-output","validation","gin","openapi"],"license":"Apache-2.0","category":"ai-agents","readme_excerpt":"godantic Pydantic for Go - JSON schema generation, LLM response validation, partial JSON streaming. --- Go's validation and schema libraries are separate — you wire them together and keep constraints in sync manually. Struct tags define constraints as magic strings you can't test or refactor easily. Go has no union types for polymorphic responses. And there's no way to parse partial JSON from streaming LLMs. godantic fixes this. One struct definition with typed methods drives schema generation, validation, and serialization together. Works with OpenAI, Anthropic, Gemini, Gin REST APIs (with OpenAPI generation), and any system that consumes JSON Schema. Inspired by Python's Pydantic and FastAPI. Key Features: - LLM-ready schemas : Generate flattened JSON Schema for OpenAI, Anthropic, Gemini structured outputs - Streaming partial JSON : Parse incomplete JSON as it streams from LLM APIs for real-time UI updates - Runtime validation : Catch hallucinated types, missing fields, and invalid enums before they crash your app - Union type support : Full anyOf / oneOf schemas with discriminators - No struct tags : Uses Field{Name}() methods—works with your IDE, tests, and debugger - Gin integration : Automatic OpenAPI generation and interactive docs LLM Structured Output Godantic solves a common problem: LLMs sometimes return invalid data (wrong types, missing fields, out-of-range values). Define your schema once, use it to guide LLM responses AND validate them. Basic Workflow Streaming","default_branch":null,"files":null,"tree":[],"storefront":"/r/deepankarm","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/deepankarm/godantic/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}