Skip to content

Commit

Permalink
revert(api): remove /plugins/schema/:name (#11313)
Browse files Browse the repository at this point in the history
Partially reverts #10846

Even though we have been emitting deprecation warnings when the endpoint
was used, we didn't remove it in 3.0, and doing it now can be a surprise
breaking change for someone. In fact, someone had to update a project
which was relying on that path, that is linked in #10846

This reverts the removal and replaces the deprecation version with 4.0
instead of 3.0. This PR does not revert the changes in our tests to use
the new endpoint instead of the deprecated one.
  • Loading branch information
kikito authored Jul 28, 2023
1 parent 6a03fae commit 1ec4d73
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions kong/api/routes/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local utils = require "kong.tools.utils"
local reports = require "kong.reports"
local endpoints = require "kong.api.endpoints"
local arguments = require "kong.api.arguments"
local api_helpers = require "kong.api.api_helpers"


local ngx = ngx
Expand Down Expand Up @@ -119,6 +120,23 @@ return {
PATCH = patch_plugin
},

["/plugins/schema/:name"] = {
GET = function(self, db)
kong.log.deprecation("/plugins/schema/:name endpoint is deprecated, ",
"please use /schemas/plugins/:name instead", {
after = "1.2.0",
removal = "4.0.0",
})
local subschema = db.plugins.schema.subschemas[self.params.name]
if not subschema then
return kong.response.exit(404, { message = "No plugin named '" .. self.params.name .. "'" })
end

local copy = api_helpers.schema_to_jsonable(subschema.fields.config)
return kong.response.exit(200, copy)
end
},

["/plugins/enabled"] = {
GET = function()
local enabled_plugins = setmetatable({}, cjson.array_mt)
Expand Down

1 comment on commit 1ec4d73

@khcp-gha-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:1ec4d73c1db104a529620109cabbb7a55b9fb468
Artifacts available https://github.com/Kong/kong/actions/runs/5694708843

Please sign in to comment.