Improved endpoint function typing and readme#318
Merged
Jesperholmbergmsft merged 1 commit intoAug 28, 2025
Merged
Conversation
Jesperholmbergmsft
marked this pull request as ready for review
August 27, 2025 16:45
heyitsaamir
approved these changes
Aug 27, 2025
aacebo
approved these changes
Aug 28, 2025
Copilot AI
added a commit
that referenced
this pull request
Feb 11, 2026
- Move isTargeted from MessageActivity to base Activity class as non-nullable boolean - Update withRecipient in Activity to accept optional isTargeted parameter - Override withRecipient in MessageActivity to maintain return type - Remove withTargetedRecipient method from MessageActivity - Update all examples and tests to use new API pattern - Update validation error messages - Add isTargeted property to devtools feedback activity Co-authored-by: rido-min <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves the endpoint functions to not generate body & parameter arguments for APIs that don't need them. This reduces type clutter a little, and avoids generating impossible signatures.
For instance,
POST /me/reprocessLicenseAssignmentwas generated with this effective signature:function create(body: never, params?: {} | undefined) : whateverThis API doesn't take any body or params at all, so the types.ts
requestBodytype for this API is 'never'. Our code has assumed that all non-get, non-delete APIs will always require a body however, so we've been happily generating thebodyargument. The result is thatbody: neverargument - which is problematic as there's nothing I can pass to satisfy it.The empty
paramstype is not problematic as such, but it's a bit of clutter.To make this PR reviewable, I only re-generated a handful of endpoints to show the difference before/after the changes. and keep the PR readable I'm planning to re-generate everything next week and that'll propagate the fixes.
Other minor things