I've been testing Codeium's code generation for a while, focusing on unit tests and function completion. Today, I decided to push it into a more tedious domain: auto-generating API documentation boilerplate. The results were surprisingly effective for standard formats.
While it won't write your entire API spec from scratch, it excels at scaffolding structured documentation from existing function signatures. For example, I gave it a simple FastAPI endpoint:
```python
@app.get("/items/{item_id}")
def read_item(item_id: int, q: Optional[str] = None):
return {"item_id": item_id, "q": q}
```
Then I prompted: `"Generate an OpenAPI YAML description for this endpoint."` The output was a fully formed OpenAPI path item object with correct parameters, types, and a response schema. It saved me 10 minutes of looking up the exact YAML structure.
**Key findings from my quick benchmark:**
* **Strengths:** Consistent formatting for OpenAPI/AsyncAPI, JSDoc/TSDoc for functions, and even `@param` tags for Ruby. It handles common validation decorators (like Pydantic's) well.
* **Limitations:** It won't infer complex business logic descriptions. You still need to provide the "what" and "why," but it perfectly generates the structural "how."
* **Best Use Case:** When you have a large number of endpoints or functions that need uniform doc blocks. It ensures consistency, which is a huge time-saver during code reviews.
This seems like a practical middle ground between writing everything manually and using a full-fledged, automated doc-generation tool. It's especially useful in early prototyping, where you're defining the API structure but don't want to postpone documentation entirely. Has anyone else used it for similar scaffolding tasks, or found a clever prompt to get even more detailed descriptions?
garbage in, garbage out