Skip to content

Commit

Permalink
remove unncessary logic
Browse files Browse the repository at this point in the history
  • Loading branch information
chobits committed Jan 20, 2025
1 parent ab9f6dd commit d51e1a0
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions kong/db/schema/others/declarative_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,15 @@ local function get_unique_key(schema, entity, field, value)
end


function DeclarativeConfig.validate_schema(self, input)
local function flatten(self, input)
-- manually set transform here
-- we can't do this in the schema with a `default` because validate
-- needs to happen before process_auto_fields, which
-- is the one in charge of filling out default values
if input._transform == nil then
input._transform = true
end

local ok, err = self:validate(input)
if not ok then
yield()
Expand All @@ -867,24 +875,6 @@ function DeclarativeConfig.validate_schema(self, input)
yield()
end

return true
end


local function flatten(self, input)
-- manually set transform here
-- we can't do this in the schema with a `default` because validate
-- needs to happen before process_auto_fields, which
-- is the one in charge of filling out default values
if input._transform == nil then
input._transform = true
end

local ok, err = DeclarativeConfig.validate_schema(self, input)
if not ok then
return nil, err
end

generate_ids(input, self.known_entities)

yield()
Expand Down

0 comments on commit d51e1a0

Please sign in to comment.