Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to convert a JSON Schema to an XSD? [closed]

I am currently looking for a way to convert a JSON Schema to an XSD or XML schema. I have found nothing on this topic and was hoping maybe someone here knew. I was hoping to do it with the Java APIs.

like image 859
Dalton Heiland Avatar asked Mar 21 '16 19:03

Dalton Heiland


People also ask

Can we generate XSD from JSON?

A possible roundabout way of getting your XSD is to start with a json doc (not the jsonschema) that's pretty complete and conformant to your jsonschema, use any of a multitude of json to xml converters, and convert your xml to xsd (one such tool here).

Does JSON have a schema like XML?

In the same way that an XML Schema specifies the structure and content of an XML document, a JSON schema specifies how the JSON data in a JSON document is organized. It specifies what data fields are expected and how the values are represented.

How to convert an XML schema to JSON Schema?

To convert an XML Schema (XSD) to a JSON Schema, follow these steps: Select the XSD to JSON Schemaaction from the Tools> JSON Toolsmenu. Step Result:The XSD to JSON Schemadialog box is displayed: Figure1. XSD to JSON Schema Dialog Box In the XSD URLfield, choose or enter the URL of the XML Schema document.

How do I convert an xsd file to a JSON file?

Oxygen XML Developer includes a tool for converting an XML Schema file (XSD) to a JSON Schema file. The XSD to JSON Schema action for invoking the tool can be found in the Tools > JSON Tools menu.

How to avoid name conflicts between XSD extensions and JSON?

If an extension in XSD defines an element with the same name as an attribute in the base, a property named rest is generated to avoid name conflicts in JSON. If a property of a complex type is a collection property, the schema of the collection items will be wrapped in the JSON array schema.

What happens when an XSD type extends another type?

If an XSD type extends another type, then its schema is combined with the schema of the base type using the allOf keyword. If an extension in XSD defines an element with the same name as an attribute in the base, a property named rest is generated to avoid name conflicts in JSON.


1 Answers

Jsons2xsd converts JSON Schema to XML Schema (XSD) and is Java based.

like image 143
kjhughes Avatar answered Sep 28 '22 00:09

kjhughes