0

This works fine, and I am able to omit Speed parameter:

[Route("/speech/sentence/", "POST")]
public class Sentence : IReturn<HttpResult>
{
    public string Input { get; set; }
    public string Speed { get; set; }
}

This does not work, gets an 'HTTP/1.1 400 Bad Request' not able to omit Speed parameter:

[Route("/speech/sentence/", "POST")]
public class Sentence : IReturn<HttpResult>
{
    public string Input { get; set; }
    public int    Speed { get; set; }
}

This also does not work, gets an 'HTTP/1.1 400 Bad Request' not able to omit Speed parameter:

[Route("/speech/sentence/", "POST")]
public class Sentence : IReturn<HttpResult>
{
    public string Input { get; set; }
    public int?    Speed { get; set; }
}

Anyone? Thanks

I.hope
  • 73
  • 6
  • 1
    What version of ServiceStack are you using? I tried your second DTO (the one with string/int) and it worked fine. Speed just defaulted to zero since it wasn't a nullable-int. Maybe show your Service that utilizes the DTO as well. Are you using any filters? – PatrickSteele Sep 02 '15 at 15:10
  • Note `IReturn` [should never return HttpResult](http://stackoverflow.com/a/13297627/85785) it should return the typed body of the HttpResult instead. – mythz Sep 02 '15 at 15:47
  • Using ServiceStack.4.0.40 – I.hope Sep 03 '15 at 07:24

0 Answers0