Add nullable_relationships method to Schemable::Definition

This commit is contained in:
Muhammad Nawzad 2024-01-30 13:15:16 +03:00
parent a2fb1cf57e
commit 213a265ddd
No known key found for this signature in database
GPG Key ID: B954B6AAE33940B2
2 changed files with 13 additions and 0 deletions

View File

@ -125,6 +125,18 @@ module Schemable
%i[]
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.
# These attributes are appended to the create request schema.
#

View File

@ -13,6 +13,7 @@ module Schemable
def array_types: -> Hash[Symbol, any]
def relationships: -> Hash[Symbol, any]
def nullable_attributes: -> Array[Symbol]
def nullable_relationships: -> Array[String]
def serialized_instance: -> Hash[Symbol, any]
def self.generate: -> Array[Hash[Symbol, any]]
def excluded_response_included: -> Array[Symbol]