Ensure API changes maintain backward compatibility to avoid breaking existing clients and workflows. When adding new functionality, use optional parameters with sensible defaults rather than required parameters. When versioning APIs, follow the `/api/v2/resource` pattern and maintain deprecated endpoints during transition periods to allow clients time to...
Ensure API changes maintain backward compatibility to avoid breaking existing clients and workflows. When adding new functionality, use optional parameters with sensible defaults rather than required parameters. When versioning APIs, follow the /api/v2/resource
pattern and maintain deprecated endpoints during transition periods to allow clients time to migrate.
Key practices:
/api/v2/userdata
rather than /userdata-v2
Example of backward-compatible parameter addition:
def INPUT_TYPES(s):
return {
"required": {
"images": ("IMAGE", ),
"filename_prefix": ("STRING", {"default": "ComfyUI"})
},
"optional": {
"disable_metadata": ("BOOLEAN", {"default": False}) # New parameter as optional
}
}
This approach prevents breaking existing API workflows while enabling new functionality for clients that choose to adopt it.
Enter the URL of a public GitHub repository