File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/resources/crystal
samples/client/petstore/crystal/src/petstore/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 # @param [Object] value Any valid value
2626 # @return [Hash] Returns the value in the form of hash
2727 private def _to_h(value)
28+ return nil if value.nil?
29+
2830 if value.is_a?(Hash)
2931 hash = NetboxClient::RecursiveHash.new
3032 value.each { |k, v| hash[k] = _to_h(v) }
Original file line number Diff line number Diff line change @@ -95,6 +95,8 @@ module Petstore
9595 # @param [Object] value Any valid value
9696 # @return [Hash] Returns the value in the form of hash
9797 private def _to_h (value )
98+ return nil if value.nil?
99+
98100 if value.is_a?(Hash )
99101 hash = NetboxClient ::RecursiveHash .new
100102 value.each { |k , v | hash[k] = _to_h(v) }
Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ module Petstore
9191 # @param [Object] value Any valid value
9292 # @return [Hash] Returns the value in the form of hash
9393 private def _to_h (value )
94+ return nil if value.nil?
95+
9496 if value.is_a?(Hash )
9597 hash = NetboxClient ::RecursiveHash .new
9698 value.each { |k , v | hash[k] = _to_h(v) }
Original file line number Diff line number Diff line change @@ -103,6 +103,8 @@ module Petstore
103103 # @param [Object] value Any valid value
104104 # @return [Hash] Returns the value in the form of hash
105105 private def _to_h (value )
106+ return nil if value.nil?
107+
106108 if value.is_a?(Hash )
107109 hash = NetboxClient ::RecursiveHash .new
108110 value.each { |k , v | hash[k] = _to_h(v) }
Original file line number Diff line number Diff line change @@ -353,6 +353,8 @@ module Petstore
353353 # @param [Object] value Any valid value
354354 # @return [Hash] Returns the value in the form of hash
355355 private def _to_h (value )
356+ return nil if value.nil?
357+
356358 if value.is_a?(Hash )
357359 hash = NetboxClient ::RecursiveHash .new
358360 value.each { |k , v | hash[k] = _to_h(v) }
Original file line number Diff line number Diff line change @@ -161,6 +161,8 @@ module Petstore
161161 # @param [Object] value Any valid value
162162 # @return [Hash] Returns the value in the form of hash
163163 private def _to_h (value )
164+ return nil if value.nil?
165+
164166 if value.is_a?(Hash )
165167 hash = NetboxClient ::RecursiveHash .new
166168 value.each { |k , v | hash[k] = _to_h(v) }
Original file line number Diff line number Diff line change @@ -162,6 +162,8 @@ module Petstore
162162 # @param [Object] value Any valid value
163163 # @return [Hash] Returns the value in the form of hash
164164 private def _to_h (value )
165+ return nil if value.nil?
166+
165167 if value.is_a?(Hash )
166168 hash = NetboxClient ::RecursiveHash .new
167169 value.each { |k , v | hash[k] = _to_h(v) }
Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ module Petstore
8686 # @param [Object] value Any valid value
8787 # @return [Hash] Returns the value in the form of hash
8888 private def _to_h (value )
89+ return nil if value.nil?
90+
8991 if value.is_a?(Hash )
9092 hash = NetboxClient ::RecursiveHash .new
9193 value.each { |k , v | hash[k] = _to_h(v) }
Original file line number Diff line number Diff line change @@ -117,6 +117,8 @@ module Petstore
117117 # @param [Object] value Any valid value
118118 # @return [Hash] Returns the value in the form of hash
119119 private def _to_h (value )
120+ return nil if value.nil?
121+
120122 if value.is_a?(Hash )
121123 hash = NetboxClient ::RecursiveHash .new
122124 value.each { |k , v | hash[k] = _to_h(v) }
You can’t perform that action at this time.
0 commit comments