Ask a Question

Ask a Question
Back to All

How can I make a parameter optional in a microservice endpoint?

How can I make a parameter optional in a microservice endpoint to avoid a 400 "Parameter requires property" error when the optional parameter is not provided? For example, I have an endpoint public async Task DoStuff(long? BeamId, string? OAuthId) and calls without OAuthId (e.g., {"BeamId": 12345}) result in this error.