LilithWittmann / ozg

Parsers/Generators for the standards related to "Onlinezugangsgesetz" esp. FIM (xDatenfelder/xZufi/xöv)
MIT License
12 stars 1 forks source link

How to deal with labels #6

Open codedust opened 1 year ago

codedust commented 1 year ago

Labels are represented as fields of type label in XDatenfelder. However, in JSON Schema, there does not exist an equivalent since JSON schema describes data, not forms.

Example:

<xdf:datenfeld>
    <xdf:identifikation>
        <xdf:id>F00000439</xdf:id>
        <xdf:version>1.0</xdf:version>
    </xdf:identifikation>
    <xdf:name>
Dokumentenbezeichnung Antrag BLE Verstossdatei Selbstauskunft
</xdf:name>
    <xdf:bezeichnungEingabe/>
    <xdf:beschreibung/>
    <xdf:definition/>
    <xdf:bezug>§§ 14a, 14b SeeFischG</xdf:bezug>
    <xdf:status listURI="urn:xoev-de:fim:codeliste:xdatenfelder.status" listVersionID="1.0">
        <code>aktiv</code>
    </xdf:status>
    <xdf:versionshinweis>Automatisch erzeugte Version</xdf:versionshinweis>
    <xdf:schemaelementart listURI="urn:xoev-de:fim:codeliste:xdatenfelder.schemaelementart" listVersionID="1.0">
        <code>RNG</code>
    </xdf:schemaelementart>
    <xdf:hilfetextEingabe/>
    <xdf:hilfetextAusgabe/>
    <xdf:feldart listURI="urn:xoev-de:fim:codeliste:xdatenfelder.feldart" listVersionID="1.0">
        <code>label</code>
    </xdf:feldart>
    <xdf:datentyp listURI="urn:xoev-de:fim:codeliste:xdatenfelder.datentyp" listVersionID="1.0">
        <code>text</code>
    </xdf:datentyp>
    <xdf:praezisierung/>
    <xdf:inhalt>
Selbstauskunft aus der Verstoßdatei des Seefischereigesetzes
</xdf:inhalt>
</xdf:datenfeld>

JSON-Schema:

        "F00000439": {
            "description": "Selbstauskunft aus der Verstoßdatei des Seefischereigesetzes",
            "title": "Dokumentenbezeichnung Antrag BLE Verstossdatei Selbstauskunft",
            "type": "string",
            "x-display": "label"
        },

This would imply an attribute called "F00000439" in the data that is represented by this JSON schema.

Thus, my proposal would be to completely ignore labels when generating the JSON schema.

What do you think?

LilithWittmann commented 1 year ago

JsonSchemaForm supports labels - i think we should at least offer a jsonschemaform version as it allows us to be relatively close to xdatenfelder. We maybe should also offer a JsonSchema Version.

codedust commented 1 year ago

In contrast, https://github.com/rjsf-team/react-jsonschema-form only seems to support labels via UISchema. Maybe supporting three different output formats is the way to go. :+1: