Skip to content

Comments

Add Pydantic validation to import_fail_info_bulk endpoint#2047

Merged
christian-byrne merged 1 commit intoComfy-Org:draft-v4from
viva-jinyi:feat/pydantic-validation-bulk-api
Jul 31, 2025
Merged

Add Pydantic validation to import_fail_info_bulk endpoint#2047
christian-byrne merged 1 commit intoComfy-Org:draft-v4from
viva-jinyi:feat/pydantic-validation-bulk-api

Conversation

@viva-jinyi
Copy link
Member

Summary

  • Regenerated Pydantic models from updated OpenAPI specification using datamodel-codegen
  • Updated import_fail_info_bulk route handler to use ImportFailInfoBulkRequest/Response models
  • Replaced manual JSON validation with type-safe Pydantic model validation
  • Added proper ValidationError handling consistent with other v2 endpoints

Changes

  • Data Models: Regenerated all Pydantic models from OpenAPI spec
  • Route Handler: Updated /v2/customnode/import_fail_info_bulk to use Pydantic validation
  • Error Handling: Added ValidationError handling with proper logging
  • Exports: Updated data_models/__init__.py to export new ImportFailInfo models

Implementation Details

  • Follows the process outlined in data_models/README.md
  • Uses ImportFailInfoBulkRequest.model_validate() for input validation
  • Returns ImportFailInfoBulkResponse for type-safe responses
  • Consistent with other v2 endpoint patterns in the codebase

Test Plan

  • Verify models generate correctly from OpenAPI spec
  • Ensure ValidationError handling matches existing patterns
  • Confirm response structure matches OpenAPI specification
  • Validate import statements and exports work correctly

Implements the Pydantic validation as discussed in the code review process.

- Regenerated Pydantic models from updated OpenAPI specification
- Updated import_fail_info_bulk route handler to use ImportFailInfoBulkRequest/Response models
- Replaced manual JSON validation with Pydantic model validation
- Added proper error handling with ValidationError
- Updated data_models/__init__.py to export new models

Following the process outlined in data_models/README.md for type safety and consistency.
Copy link
Contributor

@christian-byrne christian-byrne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@christian-byrne christian-byrne merged commit f599bc2 into Comfy-Org:draft-v4 Jul 31, 2025
3 checks passed
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.

2 participants