IntelliJ plugin XSD to JSON Schema - documentation

This should cover W3C XML Schema, Relax NG and DTD related problems.
ruzicka
Posts: 1
Joined: Thu Jun 29, 2023 7:44 am

IntelliJ plugin XSD to JSON Schema - documentation

Post by ruzicka »

Hi,
thank you for your intellij plugin (both XSD->JSON Schema and XML->JSON->YAML).
My task is to create OpenAPI v3 yaml file from XML Schema.
I managed to use your plugins:
1. xsd -> json schema
2. json -> yaml
3. I changed header to match swagger v2 format
4. an online service openapi v2 -> openapi v3
All ok (xsd -> openapi v3 would be a really good plugin if you provide one).

My problem - documentation elements in xsd are skipped during both transformations: xsd -> json schema, json schema to yaml

Code: Select all

    <complexType name="TMOS">
        <annotation>
            <documentation>Documentation text 1</documentation>
        </annotation>
        <sequence>
            <element name="ME">
                <annotation>
                    <documentation>Documentation text 2</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <maxLength value="250" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </complexType>
I would like to see in json schema:

Code: Select all

"TMOS": {
            "description": "Documentation text 1",
            "type": "object",
            "required": ["ME"],
            "properties": {
                "ME": {
                    "type": "string",
                    "description": "Documentation text 2"
                }
            }
        },
.. and in yaml:

Code: Select all

  TMOS:
    description: Documentation text 1
    type: object
    required:
    - ME
    properties:
      ME:
        description: Documentation text 2
        type: string
Is it somehow possible please?
Thank you
Peter
florin_nica
Posts: 32
Joined: Wed Sep 09, 2020 3:17 pm

Re: IntelliJ plugin XSD to JSON Schema - documentation

Post by florin_nica »

Hello,

Thank you very much for the feedback.

We use a third-party library for XSD to JSON Schema called jsonix and, unfortunately, it ignores the documentation elements when converting. This is mentioned as a limitation on our user-guide.

You may also want to check our OpenAPI editor and tools: https://www.oxygenxml.com/xml_editor/openapi.html

Regards,
Florin
Post Reply