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

ASF GitHub Bot commented on AVRO-2199:
--------------------------------------

tjwp commented on a change in pull request #320: AVRO-2199:  Validate that 
field defaults have the correct type
URL: https://github.com/apache/avro/pull/320#discussion_r203221105
 
 

 ##########
 File path: lang/ruby/test/test_default_validation.rb
 ##########
 @@ -0,0 +1,127 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+require 'test_help'
+
+class TestDefaultValidation < Test::Unit::TestCase
 
 Review comment:
   I separate these tests out for the avro-patches gem, but it may make sense 
to move them into `test_schema.rb` here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


>  Validate that field defaults have the correct type
> ---------------------------------------------------
>
>                 Key: AVRO-2199
>                 URL: https://issues.apache.org/jira/browse/AVRO-2199
>             Project: Avro
>          Issue Type: Improvement
>          Components: ruby
>    Affects Versions: 1.8.2
>            Reporter: Daniel Orner
>            Priority: Minor
>
> Currently, on the master branch, when a schema is parsed, it is possible to 
> define a field with a type and a default of a totally different type. E.g. if 
> the field has type "string", the default can be set to "null".
> I'd like to open a PR which will fix this by running the default through the 
> SchemaValidator whenever a new Field is created. See 
> [https://github.com/salsify/avro-patches/pull/16]
> cc: [~tjwp]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to