Sets configuration by default

This commit is contained in:
Muhammad Nawzad 2023-11-10 19:50:26 +03:00
parent b480c82361
commit 0118d57cb7
No known key found for this signature in database
GPG Key ID: B954B6AAE33940B2
2 changed files with 4 additions and 4 deletions

View File

@ -2,10 +2,10 @@ module Schemable
class AttributeSchemaGenerator
attr_accessor :model_definition, :configuration, :model, :schema_modifier, :response
def initialize(model_definition, configuration)
def initialize(model_definition)
@model_definition = model_definition
@model = model_definition.model
@configuration = configuration
@configuration = Schemable.configuration
@schema_modifier = SchemaModifier.new
@response = nil
end
@ -14,7 +14,7 @@ module Schemable
def generate_attributes_schema
schema = {
type: :object,
properties: @model_definition.attributes&.index_with do |attr|
properties: @model_definition.attributes.index_with do |attr|
generate_attribute_schema(attr)
end
}

View File

@ -6,7 +6,7 @@ module Schemable
attr_accessor response: Hash[Symbol, any]?
attr_accessor schema_modifier: SchemaModifier
def initialize: (Definition, Configuration) -> void
def initialize: (Definition) -> void
def generate_attributes_schema: -> (Hash[Symbol, any] | Array[any])
def generate_attribute_schema: (Symbol) -> Hash[Symbol, any]
end