mirror of
https://github.com/ditkrg/schemable.git
synced 2026-01-22 22:26:41 +00:00
Add nullable_relationships method to Schemable::Definition
This commit is contained in:
parent
a2fb1cf57e
commit
213a265ddd
@ -125,6 +125,18 @@ module Schemable
|
|||||||
%i[]
|
%i[]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns the relationships that are nullable in the response body.
|
||||||
|
# This means that they can be present in the response body but they can be null.
|
||||||
|
# They are not required to be present in the request body.
|
||||||
|
#
|
||||||
|
# @example
|
||||||
|
# ['users', 'applicant']
|
||||||
|
#
|
||||||
|
# @return [Array<String>] The attributes that are nullable in the response body.
|
||||||
|
def nullable_relationships
|
||||||
|
%w[]
|
||||||
|
end
|
||||||
|
|
||||||
# Returns the additional create request attributes that are not automatically generated.
|
# Returns the additional create request attributes that are not automatically generated.
|
||||||
# These attributes are appended to the create request schema.
|
# These attributes are appended to the create request schema.
|
||||||
#
|
#
|
||||||
|
|||||||
@ -13,6 +13,7 @@ module Schemable
|
|||||||
def array_types: -> Hash[Symbol, any]
|
def array_types: -> Hash[Symbol, any]
|
||||||
def relationships: -> Hash[Symbol, any]
|
def relationships: -> Hash[Symbol, any]
|
||||||
def nullable_attributes: -> Array[Symbol]
|
def nullable_attributes: -> Array[Symbol]
|
||||||
|
def nullable_relationships: -> Array[String]
|
||||||
def serialized_instance: -> Hash[Symbol, any]
|
def serialized_instance: -> Hash[Symbol, any]
|
||||||
def self.generate: -> Array[Hash[Symbol, any]]
|
def self.generate: -> Array[Hash[Symbol, any]]
|
||||||
def excluded_response_included: -> Array[Symbol]
|
def excluded_response_included: -> Array[Symbol]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user