Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby client nullable #4391

Merged
merged 3 commits into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ruby samples with nullable implementation
  • Loading branch information
slemrmartin committed Nov 6, 2019
commit a2cfa44ff94c9fa0fab9e4a55e3a9b039f0ca241
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -169,7 +175,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -169,7 +175,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -169,7 +175,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -275,7 +281,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -169,7 +175,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -169,7 +175,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -169,7 +175,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -169,7 +175,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# discriminator's property name in OpenAPI v3
def self.openapi_discriminator_name
:'class_name'
Expand Down Expand Up @@ -190,7 +196,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -187,7 +193,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -171,7 +177,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -171,7 +177,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -193,7 +199,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -215,7 +221,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# List of class defined in allOf (OpenAPI v3)
def self.openapi_all_of
[
Expand Down Expand Up @@ -181,7 +187,7 @@ def to_hash
hash = super
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -169,7 +175,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -185,7 +191,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
def self.openapi_nullable
[
]
end

# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
def initialize(attributes = {})
Expand Down Expand Up @@ -170,7 +176,7 @@ def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
next if value.nil?
next if value.nil? && !self.class.openapi_nullable.include?(attr)
hash[param] = _to_hash(value)
end
hash
Expand Down
Loading