Skip to content

Instantly share code, notes, and snippets.

@atjsh
atjsh / 1_README.md
Last active July 13, 2025 12:15
Gemini for Swagger Generation? (failed attempt)

i tried to use google gemini to generate OpenAPI Swagger doc, by providing structured output option as in JSON Schema spec of OpenAPI 3.0.

but it mostly failed with this error.

ApiError: {"error":{"code":400,"message":"The specified schema produces a constraint that has too many states for serving. Typical causes of this error are schemas with lots of text (for example, very long property or enum names), schemas with long array length limits (especially when nested), or schemas using complex value matchers (for example, integers or numbers with minimum/maximum bounds or strings with complex formats like date-time)","status":"INVALID_ARGUMENT"}}

and when i managed to made it work, the "Operation" definitions are mostly missing.

@atjsh
atjsh / 1_README.md
Last active July 15, 2025 04:04
Generating OpenAPI Swagger Documentation from Source Code, with GPT-4.1 (feedback welcomed)