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

new plugin: data-validator #790

Closed
membphis opened this issue Nov 2, 2019 · 4 comments
Closed

new plugin: data-validator #790

membphis opened this issue Nov 2, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@membphis
Copy link
Member

membphis commented Nov 2, 2019

Apache APISIX currently has a very high-performance jsonschema implementation that can be used to validate request parameters or request bodies.

When the verification succeeds or fails, the response specifies the response code to the requesting client.

Here is a mini case:

data_valitator = {
    var = "args_name",
    schema = {
        type = "string",
        minLength = 1,
        maxLength = 32,
        pattern = [[^[\w]+$]]
    },
    fail_code = 400,
}

data_valitator = {
    var = "args_name",
    schema = {
        type = "string",
        minLength = 1,
        maxLength = 32,
        pattern = [[^[\w]+$]]
    },
    succ_code = 200
}
@membphis membphis added the enhancement New feature or request label Nov 2, 2019
@moonming
Copy link
Member

moonming commented Nov 3, 2019

Is it support json schema v4 or v5?

@moonming
Copy link
Member

moonming commented Nov 3, 2019

    succ_code = 200

I think we don't need succ_code

@membphis
Copy link
Member Author

membphis commented Nov 4, 2019

Is it support json schema v4 or v5?

support draft4, draft6 and draft7.

@membphis
Copy link
Member Author

related PR: #1709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants