cancel
Showing results for 
Search instead for 
Did you mean: 

Optional parameters for OData Functions or Actions in cds definition (CAP with Java)

jagrati_goyal
Explorer
0 Kudos
70

Hi Everyone, 

I'm working on a BTP service using CAP with Java, and need some help with OData functions. Here's a simplified version of what I have in my `service.cds`:

function testfunction(id: String, secondparam: String) returns String;

The issue I'm facing is that both `id` and `secondparam` are required parameters. However, I want secondparam to be optional. Currently, if I omit `secondparam` when calling the function, I get an error.

Does anyone know how to make the `secondparam` optional in this case? Any guidance or examples would be greatly appreciated!

Thanks in advance! 😊

Accepted Solutions (0)

Answers (0)