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

[request] Add an api to expose the plugin schema #309

Closed
ajayk opened this issue Jun 8, 2015 · 7 comments
Closed

[request] Add an api to expose the plugin schema #309

ajayk opened this issue Jun 8, 2015 · 7 comments
Assignees
Milestone

Comments

@ajayk
Copy link
Contributor

ajayk commented Jun 8, 2015

For a plugin like filelog , an api like "/plugins/filelog/schema" which returns the plugin schema if exposed would help in creating an automated ui generation for the ever growing plugins

@thibaultcha
Copy link
Member

The tricky part with this will be custom validation functions that are used for some values.

On a side note, it would be cool to also have an endpoint to explain what the plugin is doing, like a description string.

@nijikokun
Copy link
Contributor

Kind of like the package details, I like this idea. 👍

You could also have dependencies should the plugin require or rely on another plugin.

@thibaultcha
Copy link
Member

/details is cool, and could give a response with:

{
  "name": "filelog",
  "description": "Logs to file [...]",
  "conf": {
    "path": { "type": "string" [...], "default": "...", "description": "where the logs will be written" }
  }
}

It only needs work on the description keys which don't exist for now (neither per plugin or per property).
Also notice how conf is actually the value of a plugin_configuration here, but it would also be the time to rename it.

@subnetmarco
Copy link
Member

For custom functions, we can require a structured format that also includes a description, like:

local custom_validations = {
   validate_username = {
     description = "Validates that the username is an alphanumeric string",
     func = function(val)
      -- Do something
     end
   },
   validate_zipcode = {
     description = "Something",
     func = function(val)
      -- Do something
     end
   }
}

@thibaultcha thibaultcha changed the title Add an api to expose the plugin schema [request] Add an api to expose the plugin schema Jun 26, 2015
thibaultcha added a commit that referenced this issue Jul 1, 2015
Implement a suggestion from #309 to expose a plugin's schema in the API.
This allows UI builders to abstract a part of their code.

This adds an endpoint: `/plugins` to retrieve the `enabled_plugins` of
the node and `/plugins/:name/schema` to retrieve the schema.

`/plugins` can be confounded with `/plugins_configurations` but I see no
better name for it now.

Fix #309.
@thibaultcha thibaultcha added this to the 0.4.0 milestone Jul 1, 2015
@thibaultcha thibaultcha self-assigned this Jul 1, 2015
@thibaultcha
Copy link
Member

Hi @ajayk, please check #376 to see if it satisfies your idea/needs, thanks

thibaultcha added a commit that referenced this issue Jul 3, 2015
Implement a suggestion from #309 to expose a plugin's schema in the API.
This allows UI builders to abstract a part of their code.

This adds an endpoint: `/plugins` to retrieve the `enabled_plugins` of
the node and `/plugins/:name/schema` to retrieve the schema.

`/plugins` can be confounded with `/plugins_configurations` but I see no
better name for it now.

Fix #309.
@ajayk
Copy link
Contributor Author

ajayk commented Jul 17, 2015

@thibaultcha 👍 Sorry for the delayed response , works like a charm !

@thibaultcha
Copy link
Member

Pleased to hear it'll be useful to you then

ctranxuan pushed a commit to streamdataio/kong that referenced this issue Aug 25, 2015
Implement a suggestion from Kong#309 to expose a plugin's schema in the API.
This allows UI builders to abstract a part of their code.

This adds an endpoint: `/plugins` to retrieve the `enabled_plugins` of
the node and `/plugins/:name/schema` to retrieve the schema.

`/plugins` can be confounded with `/plugins_configurations` but I see no
better name for it now.

Fix Kong#309.


Former-commit-id: 4f06a2f9a611945e2d88dfe1f392f89970908f68
hutchic added a commit that referenced this issue Jun 10, 2022
feat(openresty-patches) add patches for OpenResty 1.17.8.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants