{"id":15013022,"url":"https://github.com/ethlo/jsons2xsd","last_synced_at":"2025-04-07T17:11:23.138Z","repository":{"id":49384426,"uuid":"10928114","full_name":"ethlo/jsons2xsd","owner":"ethlo","description":"Highly configurable converter from JSON-schema to XML-schema (XSD).","archived":false,"fork":false,"pushed_at":"2023-02-24T08:53:31.000Z","size":173,"stargazers_count":83,"open_issues_count":2,"forks_count":43,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-31T16:17:10.336Z","etag":null,"topics":["converter","java","json","json-schema","jsonschema","xml","xml-schema","xsd"],"latest_commit_sha":null,"homepage":"","language":"Java","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/ethlo.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-06-25T04:23:03.000Z","updated_at":"2025-02-18T14:31:55.000Z","dependencies_parsed_at":"2024-09-30T05:01:05.549Z","dependency_job_id":null,"html_url":"https://github.com/ethlo/jsons2xsd","commit_stats":{"total_commits":81,"total_committers":9,"mean_commits":9.0,"dds":0.6049382716049383,"last_synced_commit":"096688ffe9e244c4a55a9b0aae52b310688d1d2f"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethlo%2Fjsons2xsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethlo%2Fjsons2xsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethlo%2Fjsons2xsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethlo%2Fjsons2xsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethlo","download_url":"https://codeload.github.com/ethlo/jsons2xsd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694876,"owners_count":20980733,"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":["converter","java","json","json-schema","jsonschema","xml","xml-schema","xsd"],"created_at":"2024-09-24T19:43:37.029Z","updated_at":"2025-04-07T17:11:23.102Z","avatar_url":"https://github.com/ethlo.png","language":"Java","readme":"jsons2xsd\n=========\n[![Maven Central](https://img.shields.io/maven-central/v/com.ethlo.jsons2xsd/jsons2xsd.svg)](https://search.maven.org/artifact/com.ethlo.jsons2xsd/jsons2xsd)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Coverage Status](https://coveralls.io/repos/github/ethlo/jsons2xsd/badge.svg)](https://coveralls.io/github/ethlo/jsons2xsd)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b60e8e4fd0d541c5ac669c971850316f)](https://www.codacy.com/app/ethlo/jsons2xsd?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=ethlo/jsons2xsd\u0026amp;utm_campaign=Badge_Grade)\n[![Build Status](https://travis-ci.org/ethlo/jsons2xsd.svg)](https://travis-ci.org/ethlo/jsons2xsd)\n[![GitHub issues open](https://img.shields.io/github/issues/ethlo/jsons2xsd.svg)](https://github.com/ethlo/jsons2xsd/issues)\n\n[JSON-schema](http://json-schema.org/) to [XML schema](https://www.w3.org/TR/xmlschema11-1/) converter written in Java.\n\n## Dependency\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.ethlo.jsons2xsd\u003c/groupId\u003e\n  \u003cartifactId\u003ejsons2xsd\u003c/artifactId\u003e\n  \u003cversion\u003e2.3.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n## Snapshots\n\n```xml\n\u003crepositories\u003e\n  \u003crepository\u003e\n    \u003cid\u003esonatype-nexus-snapshots\u003c/id\u003e\n    \u003csnapshots\u003e\n      \u003cenabled\u003etrue\u003c/enabled\u003e\n    \u003c/snapshots\u003e\n    \u003curl\u003ehttps://oss.sonatype.org/content/repositories/snapshots\u003c/url\u003e\n  \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\n## Usage\n\n```java\ntry (final Reader r = ...)\n{\n  final Config cfg = new Config.Builder()\n    .targetNamespace(\"http://example.com/myschema.xsd\")\n    .name(\"array\")\n    .build();\n  final Document doc = Jsons2Xsd.convert(r, cfg);\n}\n```\n\n### Example input\n```json\n{\n  \"type\":\"array\",\n  \"items\":{\n    \"type\":\"object\",\n    \"properties\":{\n      \"price\":{\n        \"type\":\"number\",\n        \"minimum\":0\n      },\n      \"name\":{\n        \"type\":\"string\",\n        \"minLength\":5,\n        \"maxLength\":32\n      },\n      \"isExpired\":{\n        \"default\":false,\n        \"type\":\"boolean\"\n      },\n      \"manufactured\":{\n        \"type\":\"string\",\n        \"format\":\"date-time\"\n      }\n    },\n    \"required\":[\n      \"price\",\n      \"name\",\n      \"manufactured\"\n    ]\n  }\n}\n```\n\n### Example output\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cschema xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:x=\"http://example.com/myschema.xsd\" elementFormDefault=\"qualified\" targetNamespace=\"http://example.com/myschema.xsd\"\u003e\n  \u003ccomplexType name=\"array\"\u003e\n    \u003csequence\u003e\n      \u003celement name=\"price\"\u003e\n        \u003csimpleType\u003e\n          \u003crestriction base=\"decimal\"\u003e\n            \u003cminInclusive value=\"0\" /\u003e\n          \u003c/restriction\u003e\n        \u003c/simpleType\u003e\n      \u003c/element\u003e\n      \u003celement name=\"name\"\u003e\n        \u003csimpleType\u003e\n          \u003crestriction base=\"string\"\u003e\n            \u003cminLength value=\"5\" /\u003e\n            \u003cmaxLength value=\"32\" /\u003e\n          \u003c/restriction\u003e\n        \u003c/simpleType\u003e\n      \u003c/element\u003e\n      \u003celement minOccurs=\"0\" name=\"isExpired\" type=\"boolean\" /\u003e\n      \u003celement name=\"manufactured\" type=\"dateTime\" /\u003e\n    \u003c/sequence\u003e\n  \u003c/complexType\u003e\n\u003c/schema\u003e\n```\n\n## Support for non-standard types and formats\n\n### Ignore unknown JSON formats\n```java\nfinal Config cfg = new Config.Builder()\n    .ignoreUnknownFormats(true)\n    ...\n    .build();\n```      \n\n### Register custom JSON formats\n```java\nfinal Config cfg = new Config.Builder()\n    .customTypeMapping(JsonSimpleType.INTEGER, \"int64\", XsdSimpleType.LONG)\n    .customTypeMapping(JsonSimpleType.INTEGER, \"int32\", XsdSimpleType.INT)\n    .customTypeMapping(JsonSimpleType.STRING, \"ext-ref\", XsdSimpleType.STRING)\n    ...\n    .build();\n```\n\n### Register non-JSON types\n```java\nfinal Config cfg = new Config.Builder()\n    .nonJsonTypeMapping(\"date-time\", XsdSimpleType.DATE_TIME)\n    .nonJsonTypeMapping(\"int\", XsdSimpleType.INT)\n    ...\n    .build();\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethlo%2Fjsons2xsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethlo%2Fjsons2xsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethlo%2Fjsons2xsd/lists"}