{"id":19327812,"url":"https://github.com/kenshoo/swagger-validator","last_synced_at":"2025-10-13T22:39:23.933Z","repository":{"id":26418474,"uuid":"29868704","full_name":"kenshoo/swagger-validator","owner":"kenshoo","description":"Jax-Rs validator for swagger","archived":false,"fork":false,"pushed_at":"2025-07-29T08:48:21.000Z","size":125,"stargazers_count":11,"open_issues_count":4,"forks_count":1,"subscribers_count":181,"default_branch":"master","last_synced_at":"2025-07-29T10:48:42.960Z","etag":null,"topics":["managedby-tec-dev","public-repo"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kenshoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-01-26T16:02:53.000Z","updated_at":"2025-07-29T08:48:23.000Z","dependencies_parsed_at":"2025-04-22T21:42:34.507Z","dependency_job_id":null,"html_url":"https://github.com/kenshoo/swagger-validator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kenshoo/swagger-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenshoo%2Fswagger-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenshoo%2Fswagger-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenshoo%2Fswagger-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenshoo%2Fswagger-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenshoo","download_url":"https://codeload.github.com/kenshoo/swagger-validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenshoo%2Fswagger-validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017146,"owners_count":26085984,"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-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["managedby-tec-dev","public-repo"],"created_at":"2024-11-10T02:18:51.423Z","updated_at":"2025-10-13T22:39:23.918Z","avatar_url":"https://github.com/kenshoo.png","language":"Java","readme":"# Swagger Validator\n[![Build Status](https://travis-ci.org/kenshoo/swagger-validator.svg?branch=master)](https://travis-ci.org/kenshoo/swagger-validator)\n\n## Overview\nValidates swagger.yaml file.\nValidation are done assuming JAX-RS resources and Jackson POJOs.\n\nThe default validations include:\n- Resources validations:\n  - The resource class exists (See x-javaClass)\n  - The resource class annotated with @Path and that the value matches.\n  - For each operation validate that:\n    - Exists method in a resource annotated with the proper annotation (e.g. GET, POST, etc.)\n    - Operation is tagged.\n- Definitions validations:\n  -  The POJO exists (See x-javaClass)\n  -  Property from definition matches a property in POJO (By default property in Swagger equals to field in POJO)\n  -  POJO doesn't use forbidden types (e.g. using primitive types is forbidden)\n  -  Warning is printed if unrecommended type is used.\n\n## Validator Elements\nThe Swagger Validator expects additional elements to be present in the swagger.yaml to perform the validations.\n#### x-javaClass\n**x-javaClass** defines the fully qualified name of the desired class. This is used to validate that the relevant class really exists in the classpath and it's a starting point for addition validations.\n\n## Download\nThe Swagger Validator is distributed using Maven Central.\n\n### Maven Dependency\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.kenshoo\u003c/groupId\u003e\n  \u003cartifactId\u003eswagger-validator\u003c/artifactId\u003e\n  \u003cversion\u003e${swagger-validator-version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Running \nThe SwaggerValidator is a simple Java class. It must be run in the classpath containing all the resources and definitions. \n\n#### Example\n```\nSwaggerValidator swaggerValidator = new SwaggerValidator(getClass().getResourceAsStream(\"/swagger.yaml\"));\nswaggerValidator.validateDefinitions();\nswaggerValidator.validateResources();\n```\nSee unit tests for more examples.\n\n#### Customization\n```\nSwaggerValidatorConf conf = new SwaggerValidatorConf() {\n    @Override\n    public Set\u003cClass\u003c?\u003e\u003e getForbiddenClasses() {\n        return Collections.emptySet();\n    }\n};\nSwaggerValidator swaggerValidator = new SwaggerValidator(getClass().getResourceAsStream(\"/swagger.yaml\"), conf);\nswaggerValidator.validateDefinitions(); // forbidden types won't be validated\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenshoo%2Fswagger-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenshoo%2Fswagger-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenshoo%2Fswagger-validator/lists"}