{"id":15012952,"url":"https://github.com/victools/jsonschema-generator","last_synced_at":"2025-05-14T19:09:42.685Z","repository":{"id":38399194,"uuid":"184872276","full_name":"victools/jsonschema-generator","owner":"victools","description":"Java JSON Schema Generator – creating JSON Schema (Draft 6, Draft 7, Draft 2019-09, or Draft 2020-12) from Java classes","archived":false,"fork":false,"pushed_at":"2025-05-08T21:16:38.000Z","size":2358,"stargazers_count":444,"open_issues_count":20,"forks_count":62,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-14T19:09:37.338Z","etag":null,"topics":["jackson","java","json-schema","jsonschema-generator"],"latest_commit_sha":null,"homepage":"https://victools.github.io/jsonschema-generator","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/victools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-05-04T08:51:51.000Z","updated_at":"2025-05-13T16:29:38.000Z","dependencies_parsed_at":"2023-10-30T00:26:56.446Z","dependency_job_id":"fc911802-2fce-4b39-b637-7c44561f762d","html_url":"https://github.com/victools/jsonschema-generator","commit_stats":{"total_commits":471,"total_committers":16,"mean_commits":29.4375,"dds":0.3970276008492569,"last_synced_commit":"cdf5aff71c6f2035fcdcfa90c539f0465d055e10"},"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victools%2Fjsonschema-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victools%2Fjsonschema-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victools%2Fjsonschema-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victools%2Fjsonschema-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victools","download_url":"https://codeload.github.com/victools/jsonschema-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254209859,"owners_count":22032897,"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","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":["jackson","java","json-schema","jsonschema-generator"],"created_at":"2024-09-24T19:43:30.267Z","updated_at":"2025-05-14T19:09:40.615Z","avatar_url":"https://github.com/victools.png","language":"Java","readme":"# Java JSON Schema Generator\n[![Build Status](https://github.com/victools/jsonschema-generator/workflows/Java%20CI%20(Maven)/badge.svg)](https://github.com/victools/jsonschema-generator/actions?query=workflow%3A%22Java+CI+%28Maven%29%22)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.victools/jsonschema-generator/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.victools/jsonschema-generator)\n\nCreating JSON Schema (Draft 6, Draft 7, Draft 2019-09 or Draft 2020-12) from your Java classes utilising Jackson.\n\n----\n\nThis project consists of:\n- the [victools/jsonschema-generator](jsonschema-generator) (the only thing you need to get started)\n- a few modules bundling standard configurations for your convenience:\n    - [victools/jsonschema-module-jackson](jsonschema-module-jackson) – deriving JSON Schema attributes from `jackson` annotations (e.g. \"description\", property name overrides, what properties to ignore) as well as looking up appropriate (annotated) subtypes\n    - [victools/jsonschema-module-jakarta-validation](jsonschema-module-jakarta-validation) – deriving JSON Schema attributes from `jakarta.validation.constraints` annotations (e.g. which properties are nullable or not, their \"minimum\"/\"maximum\", \"minItems\"/\"maxItems\", \"minLength\"/\"maxLength\")\n    - [victools/jsonschema-module-javax-validation](jsonschema-module-javax-validation) – deriving JSON Schema attributes from `javax.validation` annotations (e.g. which properties are nullable or not, their \"minimum\"/\"maximum\", \"minItems\"/\"maxItems\", \"minLength\"/\"maxLength\")\n    - [victools/jsonschema-module-swagger-1.5](jsonschema-module-swagger-1.5) – deriving JSON Schema attributes from `swagger` (1.5.x) annotations (e.g. \"description\", property name overrides, what properties to ignore, their \"minimum\"/\"maximum\", \"const\"/\"enum\")\n    - [victools/jsonschema-module-swagger-2](jsonschema-module-swagger-2) – deriving JSON Schema attributes from `swagger` (2.x) `@Schema` annotations\n- the [victools/jsonschema-maven-plugin](jsonschema-maven-plugin) – allowing you to generate JSON Schemas as part of your Maven build\n\nAnother example for such a module is:\n- [imIfOu/jsonschema-module-addon](https://github.com/imIfOu/jsonschema-module-addon) – deriving JSON Schema attributes from a custom annotation with various parameters, which is part of the module.\n\n----\n\n## Documentation\nJavaDoc is being used throughout the codebase, offering contextual information in your respective IDE or being available online through services like [javadoc.io](https://www.javadoc.io/doc/com.github.victools/jsonschema-generator).\n\nAdditional documentation and configuration examples can be found here: https://victools.github.io/jsonschema-generator\n\n----\n\n## Usage\n### Dependency (Maven)\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.victools\u003c/groupId\u003e\n    \u003cartifactId\u003ejsonschema-generator\u003c/artifactId\u003e\n    \u003cversion\u003e4.38.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nSince version `4.7`, the release versions of the main generator library and the (standard) `victools` modules listed above are aligned.\nIt is recommended to use identical versions for all of them to ensure compatibility.\n\nIt is discouraged to use an older/lower `jsonschema-generator` version than any of your `jsonschema-module-*` dependencies. If the module uses any feature only added to the `jsonschema-generator` in the newer version, runtime errors are to be expected.\n\n### Code\n#### Complete/Minimal Example\n```java\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.github.victools.jsonschema.generator.OptionPreset;\nimport com.github.victools.jsonschema.generator.SchemaGenerator;\nimport com.github.victools.jsonschema.generator.SchemaGeneratorConfig;\nimport com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;\nimport com.github.victools.jsonschema.generator.SchemaVersion;\n```\n```java\nSchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2020_12, OptionPreset.PLAIN_JSON);\nSchemaGeneratorConfig config = configBuilder.build();\nSchemaGenerator generator = new SchemaGenerator(config);\nJsonNode jsonSchema = generator.generateSchema(YourClass.class);\n\nSystem.out.println(jsonSchema.toPrettyString());\n```\n\nAdditional examples can be found in the [jsonschema-examples](jsonschema-examples) folder or throughout the various tests classes.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictools%2Fjsonschema-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictools%2Fjsonschema-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictools%2Fjsonschema-generator/lists"}