diff --git a/devel/verify-vim-wsdl.rb b/devel/verify-vim-wsdl.rb index 7186ef4..e151056 100755 --- a/devel/verify-vim-wsdl.rb +++ b/devel/verify-vim-wsdl.rb @@ -87,7 +87,24 @@ def wsdl_constantize(type) # Print a warning that the type is missing and skip it. if vmodl_data.nil? puts " #{type_name} is missing" - next + next unless options[:fix] + + vmodl_data = { + 'kind' => 'data', + 'wsdl_base' => type.complexcontent.extension.base.name, + 'props' => type.elements.map do |element| + { + 'name' => element.name.name, + 'is-optional' => element.minoccurs == 0, + 'is-array' => element.maxoccurs != 1, + 'version-id-ref' => nil, + 'wsdl_type' => wsdl_to_vmodl_type(element.type.name) + } + end + } + + vmodl[type_name] = vmodl_data + vmodl['_typenames']['_typenames'] << type_name end # Index the properties by name to make it simpler to find later