Conversation
…d tests; update settings for SonarLint integration.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a comprehensive OpenAPI-generated Python client for the Templafy API, replacing the existing simple models with fully-featured client wrappers. The change represents a complete overhaul from basic HTTP client operations to a structured OpenAPI client implementation.
Key Changes:
- Model System Replacement: Replaced simple placeholder model classes with auto-generated OpenAPI models using the
attrslibrary for data validation and serialization - Client Architecture Overhaul: Completely restructured the client architecture to use
attrs-based clients with proper async support and configuration management - API Endpoint Generation: Generated comprehensive API endpoint modules with both synchronous and asynchronous functions for all supported operations
Reviewed Changes
Copilot reviewed 116 out of 454 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/templafy/models/init.py | Replaced simple model classes with comprehensive OpenAPI model imports and exports |
| src/templafy/errors.py | Simplified error handling to use UnexpectedStatus exception pattern |
| src/templafy/client.py | Complete rewrite using attrs-based Client and AuthenticatedClient classes with async support |
| src/templafy/models/color_theme_field_schema.py | New OpenAPI model with attrs decorators for color theme field schema |
| src/templafy/api//.py | Generated API endpoint modules with sync/async functions for CRUD operations across all resource types |
|
|
||
| headers["Content-Type"] = "application/json-patch+json" | ||
| if isinstance(body, CreateLinkRequest): | ||
| _kwargs["json"] = body.to_dict() | ||
|
|
||
| headers["Content-Type"] = "application/json" | ||
| if isinstance(body, CreateLinkRequest): | ||
| _kwargs["json"] = body.to_dict() | ||
|
|
||
| headers["Content-Type"] = "application/*+json" | ||
|
|
There was a problem hiding this comment.
Duplicate code blocks with identical isinstance checks but different Content-Type headers. This creates redundant assignments where the same _kwargs['json'] is set three times and headers['Content-Type'] is overwritten. Consider consolidating into a single block or using a more appropriate pattern to handle multiple content types.
| headers["Content-Type"] = "application/json-patch+json" | |
| if isinstance(body, CreateLinkRequest): | |
| _kwargs["json"] = body.to_dict() | |
| headers["Content-Type"] = "application/json" | |
| if isinstance(body, CreateLinkRequest): | |
| _kwargs["json"] = body.to_dict() | |
| headers["Content-Type"] = "application/*+json" | |
| headers["Content-Type"] = "application/json" |
| body (CreateLinkRequest): The request model to create a link asset | ||
| body (CreateLinkRequest): The request model to create a link asset |
There was a problem hiding this comment.
Duplicate documentation entries for the body parameter. The docstring should contain only one entry per parameter.
| body (CreateLinkRequest): The request model to create a link asset | |
| body (CreateLinkRequest): The request model to create a link asset |
…ation clarity (See <attachments> above for file contents. You may not need to search or read the file again.)

No description provided.