Why am I getting this error when trying to install the plugin? config.<field name>:unknown field,config: <filed name>:"required field missing
elrobertcharle opened this issue · comments
lua.schema:
local typedefs = require "kong.db.schema.typedefs"
return {
name = "asheauth",
fields = {
{
route = typedefs.no_route,
},
{
service = typedefs.no_service,
},
{
consumer = typedefs.no_consumer,
},
{
protocols = typedefs.protocols_http,
},
{
config = {
type = "record",
fields = {
{ uncontrolled_routes = { type = "array", required = false, elements = { type = "string" } }, },
{ authorization_route = { type = "string", required = true}}
},
},
},
},
}
Trying to install plugin globaly:
Request:
POST http://localhost:8001/plugins HTTP/1.1
User-Agent: Fiddler
Content-Type: application/json
Host: localhost:8001
Content-Length: 101
{"name":"kong-asheauth",
"protocols":["http"],
"config.authorization_route":"123",
"enabled":true}
Response:
HTTP/1.1 **400 Bad Request**
Date: Wed, 26 Oct 2022 08:53:38 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Access-Control-Allow-Origin: *
Content-Length: 278
X-Kong-Admin-Latency: 5
Server: kong/3.0.0
{"fields":{"config.authorization_route":"unknown field","config":{"authorization_route":"required field missing"}},"message":"2 schema violations (config.authorization_route: required field missing; config.authorization_route: unknown field)","name":"schema violation","code":2}
Hi @elrobertcharle ,
can you please include some more details? What's the configuration you are trying to sync? What is the decK command you are using? What is the decK and Kong version you are running?
The returned error is stating that the request is missing the required authorization_route
configuration field.
the kong.config:
log_level = debug
plugins = bundled,kong-asheauth
The returned error is stating that the request is missing the required
authorization_route
configuration field.
As you can see in the request for install the plugin I sent the authorization_route field with "123" value
I'm using Kong with DB
Sorry, I meant the decK config file you are using. How are you running decK?
I think I'm not using decK because I am using Kong with DB, correct me if I'm wrong
Oh okay, then please open an issue here: https://github.com/Kong/kong/issues/new/choose
That's better suited for Kong-related issues.
Ok, thank you