Open ivarne opened 1 year ago
Not sure if this is a studio or frontend problem, but we have an app with minInclusive and maxExclusive restrictions on a <xsd:gYear element
minInclusive
maxExclusive
<xsd:gYear
<xsd:simpleType name="RegnskapAr-17102_Ar1980AretsAr-107" seres:elementtype="Tallrestriksjon" seres:guid="http://seres.no/guid/Finanstilsynet/Tallrestriksjon/Ar1980AretsAr-107/522188"> <xsd:restriction base="xsd:gYear"> <xsd:minInclusive value="1980"/> <xsd:maxExclusive value="9999"/> </xsd:restriction> </xsd:simpleType>
This causes the following json schema to be generated.
"RegnskapAr-17102_Ar1980AretsAr-107": { "@xsdType": "gYear", "type": "string", "format": "year", "@xsdStructure": "XmlSchemaSimpleTypeRestriction", "formatMinimum": "1980", "formatExclusiveMaximum": "9999", "@xsdUnhandledAttributes": { "seres:elementtype": "Tallrestriksjon", "seres:guid": "http://seres.no/guid/Finanstilsynet/Tallrestriksjon/Ar1980AretsAr-107/522188" } },
This causes the app to crash with the following error in the console Error: "formatMinimum": format "year" does not define "compare" function
Error: "formatMinimum": format "year" does not define "compare" function
See commit that "fixed" this issue by removing restrictions https://altinn.studio/repos/krt/krt-1007a-1/commit/23c3bc5cf3ab63c229136bf1c0d504df82d5bd40
The previous commit can be used to test the issue. https://altinn.studio/repos/krt/krt-1007a-1/src/commit/6305ec84365740f627705a6a24282d1f1aa26f6f
Add that this is low priority for us now, but when I figured it out I wanted to document it somewhere. The workaround by removing the restrictions works fine.
Description of the bug
Not sure if this is a studio or frontend problem, but we have an app with
minInclusive
andmaxExclusive
restrictions on a<xsd:gYear
elementThis causes the following json schema to be generated.
This causes the app to crash with the following error in the console
Error: "formatMinimum": format "year" does not define "compare" function
Additional Information
See commit that "fixed" this issue by removing restrictions https://altinn.studio/repos/krt/krt-1007a-1/commit/23c3bc5cf3ab63c229136bf1c0d504df82d5bd40
The previous commit can be used to test the issue. https://altinn.studio/repos/krt/krt-1007a-1/src/commit/6305ec84365740f627705a6a24282d1f1aa26f6f