Skip to content

Commit 4b4c337

Browse files
committed
for patterns array of a pattern
1 parent f73102e commit 4b4c337

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/open_api_import.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,6 @@ class << self
906906
# Get patterns
907907
private def get_patterns(dpk, dpv)
908908
data_pattern = []
909-
910909
if dpv.keys.include?(:pattern)
911910
#todo: control better the cases with back slashes
912911
if dpv[:pattern].include?('\\\\/')
@@ -951,6 +950,10 @@ class << self
951950
data_pattern += get_patterns("#{dpk}.#{dpkk}",dpvv)
952951
end
953952
end
953+
elsif dpv[:type] == 'array' and dpv.key?(:items) and dpv[:items].is_a?(Hash) and
954+
!dpv[:items].key?(:enum) and !dpv[:items].key?(:properties) and dpv[:items].key?(:type)
955+
#{:title=>"labels", :description=>"Labels specified for the file system", :type=>"array", :items=>{:type=>"string", :enum=>["string"]}}
956+
data_pattern << "'#{dpk}': [ #{get_patterns('', dpv[:items]).join[4..-1]} ]"
954957
elsif dpv[:type] == 'object' and dpv.key?(:properties)
955958
dpv[:properties].each do |dpkk,dpvv|
956959
if dpk == ''

0 commit comments

Comments
 (0)