{"id":14986699,"url":"https://github.com/nawaz1991/kong-plugin-oasvalidator","last_synced_at":"2025-07-23T11:04:55.863Z","repository":{"id":203156840,"uuid":"708959232","full_name":"nawaz1991/kong-plugin-oasvalidator","owner":"nawaz1991","description":"A Kong plugin for validating HTTP requests against OpenAPI specifications.","archived":false,"fork":false,"pushed_at":"2023-11-21T17:02:17.000Z","size":16,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T23:01:48.986Z","etag":null,"topics":["json-validation","kong","kong-gateway","kong-plugin","lua","oas","openapi","openapi-validation","openapi-validator","openresty","rest-validators","swagger","validation","validator"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nawaz1991.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-23T18:21:06.000Z","updated_at":"2024-07-12T13:27:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"96bdbbad-4908-4474-ab72-5e899f5ffc55","html_url":"https://github.com/nawaz1991/kong-plugin-oasvalidator","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"f30a1d55e310c17b464c137bccf1fccb2c9e14e3"},"previous_names":["nawaz1991/kong-plugin-oasvalidator"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nawaz1991/kong-plugin-oasvalidator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nawaz1991%2Fkong-plugin-oasvalidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nawaz1991%2Fkong-plugin-oasvalidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nawaz1991%2Fkong-plugin-oasvalidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nawaz1991%2Fkong-plugin-oasvalidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nawaz1991","download_url":"https://codeload.github.com/nawaz1991/kong-plugin-oasvalidator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nawaz1991%2Fkong-plugin-oasvalidator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266665781,"owners_count":23964972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json-validation","kong","kong-gateway","kong-plugin","lua","oas","openapi","openapi-validation","openapi-validator","openresty","rest-validators","swagger","validation","validator"],"created_at":"2024-09-24T14:13:22.508Z","updated_at":"2025-07-23T11:04:55.789Z","avatar_url":"https://github.com/nawaz1991.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛡️ OASValidator Kong Plugin\n\n`kong-plugin-oasvalidator` is a Kong plugin that validates incoming HTTP requests against OpenAPI specifications. It offers a granular level of validation including request, body, path parameters, query parameters, header parameters, and routes.\n\n## 📚 Table of Contents\n1. [Features](#-features)\n2. [Prerequisites](#-prerequisites)\n3. [Installation](#-installation)\n4. [Configuration](#-configuration)\n5. [Usage](#-usage)\n6. [Validation Strategies](#-validation-strategies)\n7. [Troubleshooting](#-troubleshooting)\n8. [License](#-license)\n\n## 🌟 Features\n\n- Validates the entire request or individual parts like body, path, query, and header.\n- Low latency and high efficiency.\n- Highly configurable through Kong's admin API.\n\n## 🔧 Prerequisites\n\n- Kong \u003e= 2.x.x\n- LUA \u003e= 5.1\n\n## 📦 Installation\n\nInstall it as a LuaRocks package:\n\n```bash\nluarocks install oasvalidator\n```\n\n## ⚙️ Configuration\n\nYou can add the plugin with the following request:\n\n```bash\ncurl -X POST http://localhost:8001/services/{serviceName|Id}/plugins \\\n--data \"name=oasvalidator\" \\\n--data \"config.oas_spec_path=/path/to/oas/spec\" \\\n--data \"config.validate_request=true\" \\\n--data \"config.validate_body=false\" \\\n--data \"config.validate_path_params=false\" \\\n--data \"config.validate_query_params=false\" \\\n--data \"config.validate_header_params=false\" \\\n--data \"config.validate_route=false\"\n```\n\nOr, you can use *Declarative (YAML)* to configure:\n```yaml\n_services:\n- name: my-service\n  url: http://example.com\n  plugins:\n    - name: oasvalidator\n      config:\n        oas_spec_path: \"/path/to/oas/spec\"\n        validate_request: true\n        validate_body: false\n        validate_path_params: false\n        validate_query_params: false\n        validate_header_params: false\n        validate_route: false\n```\n\n### Schema\n\n```lua\n-- Refer to the schema.lua file for the full configuration schema\n```\n\n### Parameters\n\n- `oas_spec_path`: Path to the OpenAPI specification file (required).\n- `validate_request`: Validate the entire request (super set of all validations). Default is true.\n- `validate_body`: Validate request body against the OpenAPI spec. Default is false.\n- `validate_path_params`: Validate path parameters against the OpenAPI spec. Default is false.\n- `validate_query_params`: Validate query parameters against the OpenAPI spec. Default is false.\n- `validate_header_params`: Validate header parameters against the OpenAPI spec. Default is false.\n- `validate_route`: Validate route against the OpenAPI spec. Default is false.\n\n## 🔍 Usage\n\nAfter installation and configuration, the plugin will validate incoming requests based on the rules you've set.\n\n## 📜 Validation Strategies\n\n- **Validate Request**: This is a super set of all other validators. If this is enabled, all other validators should be set to false.\n- **Individual Validations**: You can also use individual validators for the body, path parameters, query parameters, header parameters, and routes.\n\n## 🛠️ Troubleshooting\n\nCheck the Kong error logs for any issues. Error logs provide detailed information about what went wrong, aiding in rapid debugging.\n\n```bash\ntail -f /usr/local/kong/logs/error.log\n```\n\n## 📄 License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for the full license text.\n\n© 2023 [Muhammad Nawaz](mailto:m.nawaz2003@gmail.com). All Rights Reserved.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnawaz1991%2Fkong-plugin-oasvalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnawaz1991%2Fkong-plugin-oasvalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnawaz1991%2Fkong-plugin-oasvalidator/lists"}