Problem
Currently, the accountId parameter is optional in resource class constructors (e.g., ContactFields, Contacts, etc.), but it's used directly in URL template construction. This can lead to malformed URLs like /api/accounts/undefined/contacts/fields when accountId is not provided.
Proposed Solution
Make accountId a required parameter (remove the ?) in all resource class constructors under src/lib/api/resources/ to enforce compile-time safety and prevent runtime URL construction errors.
Affected Files
All resource classes in:
This change should be applied consistently across the codebase to ensure all resources validate the presence of accountId at compile time.
Context
This issue was identified during the review of PR #89.
Related PR: #89
Related Comment: #89 (comment)
Reported by: @narekhovhannisyan
Problem
Currently, the
accountIdparameter is optional in resource class constructors (e.g., ContactFields, Contacts, etc.), but it's used directly in URL template construction. This can lead to malformed URLs like/api/accounts/undefined/contacts/fieldswhenaccountIdis not provided.Proposed Solution
Make
accountIda required parameter (remove the?) in all resource class constructors undersrc/lib/api/resources/to enforce compile-time safety and prevent runtime URL construction errors.Affected Files
All resource classes in:
src/lib/api/resources/This change should be applied consistently across the codebase to ensure all resources validate the presence of
accountIdat compile time.Context
This issue was identified during the review of PR #89.
Related PR: #89
Related Comment: #89 (comment)
Reported by: @narekhovhannisyan