Navigation Menu

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

feat(db) add generate_admin_api schema option #3861

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion kong/api/init.lua
Expand Up @@ -240,7 +240,7 @@ do

-- Auto Generated Routes
for _, dao in pairs(singletons.db.daos) do
if not dao.schema.legacy then
if dao.schema.generate_admin_api ~= false and not dao.schema.legacy then
routes = Endpoints.new(dao.schema, routes)
end
end
Expand Down
8 changes: 8 additions & 0 deletions kong/db/schema/metaschema.lua
Expand Up @@ -64,6 +64,7 @@ local field_schema = {
{ on_delete = { type = "string", one_of = { "restrict", "cascade", "null" } }, },
{ default = { type = "self" }, },
{ abstract = { type = "boolean" }, },
{ generate_admin_api = { type = "boolean" }, },
{ legacy = { type = "boolean" }, },
}

Expand Down Expand Up @@ -342,6 +343,13 @@ local MetaSchema = Schema.new({
nilable = true,
},
},
{
generate_admin_api = {
type = "boolean",
nilable = true,
default = true,
},
},
{
legacy = {
type = "boolean",
Expand Down