Autodesk / Autodesk/moldflow-api
Standardize handling of None arguments across API calls using coerce_optional_dispatch
- Dominant language
- Python
- Stars
- 12
- Forks
- 2
- Avg merge
- 2h 31m
- Merged PRs (30d)
- 2
Description
Currently, `None` is a valid argument for all API calls, but we don’t consistently handle it across the codebase. In cases where `None` is not explicitly supported, the function itself should take care of it internally.
To streamline this behavior, we should introduce a standardized mechanism for handling arguments. The proposed approach is to use `coerce_optional_dispatch` as a centralized solution for normalizing None inputs before further processing.
**Benefits:**
- Consistent handling of None across all APIs
- Reduces duplicated argument checks in multiple places
- Improves code readability and maintainability
- Ensures cleaner error handling and edge case management
**Action items:**
- Review all API functions for current None handling.
- Introduce coerce_optional_dispatch where applicable.
- Remove redundant argument validation logic.
- Add unit tests to confirm consistent handling of None inputs.
Contributor guide
Assessment
This issue has not been assessed yet.