Skip to content

📝 docs(openapi): enrich schemas and document all endpoints with standard errors - #91

Closed
chottokun wants to merge 1 commit into
mainfrom
docs-enrich-openapi-swagger-schemas-4603548394163471290
Closed

chottokun wants to merge 1 commit into
mainfrom
docs-enrich-openapi-swagger-schemas-4603548394163471290

Conversation

@chottokun

Copy link
Copy Markdown
Owner

Enrich OpenAPI and Swagger UI documentation in main.py and schemas.py. Add detailed field descriptions, realistic examples for /v1/embeddings, /v1/rerank, /v1/models, /v1/models/unload, and declare standard error response schemas (400, 401, 413, 429, 503). Ensure schema validity.


PR created automatically by Jules for task 4603548394163471290 started by @chottokun

…ard errors

What:
- Added detailed `description` and `examples` fields to Pydantic schemas (`EmbeddingRequest`, `RerankRequest`, etc.) in `src/app/schemas.py` using Pydantic V2 `Field` constructs.
- Added new `ErrorResponse`, `ModelList`, and `ModelCard` schemas.
- Implemented `/v1/models` (GET) to list available models from `EMBEDDING_MODELS` and `RERANK_MODELS`.
- Implemented `/v1/models/unload` (POST) to clear the model cache (`_model_cache.clear()`).
- Documented all endpoints in `src/app/main.py` with OpenAPI tags, summaries, and complete `responses` dicts covering 400, 401, 413, 429, 500, and 503 errors.

Why:
- To provide better developer experience and auto-generated Swagger UI documentation for clients consuming the API.
- To maintain parity with standard OpenAI API behavior (e.g., listing models).

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@chottokun

Copy link
Copy Markdown
Owner Author

Superseded by #90 (merged in commit 8b269a0), which already incorporated OpenAPI schema enhancements, ErrorResponse schemas, /v1/models endpoints, and full documentation.

@chottokun chottokun closed this Sep 14, 2026
@chottokun
chottokun deleted the docs-enrich-openapi-swagger-schemas-4603548394163471290 branch September 14, 2026 11:43
@google-labs-jules

Copy link
Copy Markdown
Contributor

Superseded by #90 (merged in commit 8b269a0), which already incorporated OpenAPI schema enhancements, ErrorResponse schemas, /v1/models endpoints, and full documentation.

Understood. Acknowledging that this work is now superseded by #90 and stopping work on this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant