Skip to content

Fixed missing mapping of required attributes if property is nillable#1887

Merged
tfr42 merged 1 commit into
deegree:mainfrom
lat-lon:fix/missingRequiredAttributes-907
Oct 16, 2025
Merged

Fixed missing mapping of required attributes if property is nillable#1887
tfr42 merged 1 commit into
deegree:mainfrom
lat-lon:fix/missingRequiredAttributes-907

Conversation

@lgoltz

@lgoltz lgoltz commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

Using the Gml Tools SqlFeatureStoreConfigCreator the mapping of required attributes is missing if a property is nilled.

deegree-tools-gml.jar SqlFeatureStoreConfigCreator -idtype=uuid -useRefDataProps=true -format=all -deegree.gml.parse.recognize-deprecated-types=false -dbschema=alkis -referenceData=building.gml -schemaUrl=https://inspire.ec.europa.eu/schemas/bu-core2d/4.0/BuildingsCore2D.xsd

Example from https://inspire.ec.europa.eu/schemas/bu-core2d/4.0/BuildingsCore2D.xsd:

<complexType name="MeasureType">
  <simpleContent>
    <extension base="double">
      <attribute name="uom" type="gml:UomIdentifier" use="required"/>
    </extension>
  </simpleContent>
</complexType>

uom is a required attribute but missing in the resulting mapping:;

<Complex path="bu-base:horizontalGeometryEstimatedAccuracy">
  <Primitive path="@xsi:nil" mapping="bu_core2d_geometry2d_bu_base_buildinggeometry2d_bu_base_hori_24"/>
  <Primitive path="@nilReason" mapping="bu_core2d_geometry2d_bu_base_buildinggeometry2d_bu_base_hori_25"/>
</Complex>

The referenceData contains the property:

 <bu-base:horizontalGeometryEstimatedAccuracy uom="m" nilReason="other:unpopulated" xsi:nil="true"></bu-base:horizontalGeometryEstimatedAccuracy>

This PR fixes the Gml Tool by writing the mapping of required attributes even if the property is nilled:

<Complex path="bu-base:horizontalGeometryEstimatedAccuracy">
  <Primitive path="@xsi:nil" mapping="bu_core2d_geometry2d_bu_base_buildinggeometry2d_bu_base_hori_44"/>
  <Primitive path="@nilReason" mapping="bu_core2d_geometry2d_bu_base_buildinggeometry2d_bu_base_hori_45"/>
  <Primitive path="@uom" mapping="bu_core2d_geometry2d_bu_base_buildinggeometry2d_bu_base_hori_46"/>
</Complex>

@lgoltz lgoltz added bug error issue and bug (fix) tools deegree command line tools (CLI) labels Oct 16, 2025
@lgoltz lgoltz added this to the 3.6.2 milestone Oct 16, 2025
@tfr42 tfr42 changed the title Fix missing mapping of required attributes if property is nilled Fixed missing mapping of required attributes if property is nillable Oct 16, 2025
@tfr42 tfr42 merged commit dd94758 into deegree:main Oct 16, 2025
1 check passed
@tfr42 tfr42 deleted the fix/missingRequiredAttributes-907 branch October 16, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug error issue and bug (fix) tools deegree command line tools (CLI)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants