[ 
https://issues.apache.org/jira/browse/THRIFT-809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14160571#comment-14160571
 ] 

ASF GitHub Bot commented on THRIFT-809:
---------------------------------------

Github user noazark commented on the pull request:

    https://github.com/apache/thrift/pull/232#issuecomment-58058114
  
    I'm not sure if I understand the problem. It looks like the failure occurs 
here (last line):
    
    ```js
    ThriftTest.Xception = function(args) {
      this.errorCode = null;
      this.message = null;
      if (args) {
        if (args.errorCode !== undefined) {
          this.errorCode = args.errorCode;
        }
        if (args.message !== undefined) {
          this.message = args.message;
        }
      }
    };
    Thrift.inherits(ThriftTest.Xception, Thrift.TException); // Line 871, 
ReferenceError: Can't find variable: Thrift
    ```
    
    To my eyes the problem is that the Thrift global is not loaded at this 
point, but that seems weird. Any ideas?


> Javascript client: Please make required fields actually required. 
> ------------------------------------------------------------------
>
>                 Key: THRIFT-809
>                 URL: https://issues.apache.org/jira/browse/THRIFT-809
>             Project: Thrift
>          Issue Type: Improvement
>          Components: JavaScript - Compiler
>            Reporter: Jordan
>
> If fields are marked as required then I think that we should be forced to 
> supply all of them, even if supplied with null values. Currently, I am able 
> to construct an object without all of the required fields, send it to my 
> backend, and nowhere does an error occur before sending. This should fail 
> fast at the client. Instead, on the server I get null values. Null is so 
> different than unspecified. 
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to