Repository navigation
Upgrade to NeTEx 2.0 schema - #270
Merged
Merged
Conversation
vpaturet
force-pushed
the
upgrade-netex-2.0
branch
2 times, most recently
from
February 3, 2026 00:45
11e1aef to
0e84185
Compare
|
vpaturet
force-pushed
the
upgrade-netex-2.0
branch
from
February 3, 2026 00:53
0e84185 to
e0d9a96
Compare
vpaturet
added a commit
to entur/OpenTripPlanner
that referenced
this pull request
Feb 3, 2026
This update adapts OTP to the breaking changes in netex-java-model 3.0.0-SNAPSHOT based on the NeTEx 2.0 schema. Key changes include: Breaking API changes addressed: - MultilingualString: Uses mixed content model - getContent() returns List<Serializable> instead of getValue() returning String. Added MultilingualStringMapper.getStringValue() helper method. - Enum rename: AllVehicleModesOfTransportEnumeration renamed to AllPublicTransportModesEnumeration. - Collection getter naming: Some methods renamed with _Dummy suffix (e.g., getLine_Dummy(), getRoute_Dummy()). - PublicCode/PrivateCode: Now return structure types requiring .getValue() to get String. - StopPlacesInFrame_RelStructure: Now returns List<StopPlace> directly instead of wrapped JAXBElements. - DatedServiceJourney: getJourneyRef() returns single element instead of List, uses getReplacedJourneys() for replacements. - ServiceAlterationEnumeration: New PROVISIONAL value added, mapped to PLANNED. See: entur/netex-java-model#270
vpaturet
force-pushed
the
upgrade-netex-2.0
branch
from
February 3, 2026 03:45
e0d9a96 to
3ba2a76
Compare
erlendnils1
pushed a commit
to entur/netex-protobuf
that referenced
this pull request
Feb 4, 2026
vpaturet
force-pushed
the
upgrade-netex-2.0
branch
from
February 25, 2026 13:10
3ba2a76 to
17e75e3
Compare
vpaturet
added a commit
to entur/OpenTripPlanner
that referenced
this pull request
Feb 25, 2026
This update adapts OTP to the breaking changes in netex-java-model 3.0.0-SNAPSHOT based on the NeTEx 2.0 schema. Key changes include: Breaking API changes addressed: - MultilingualString: Uses mixed content model - getContent() returns List<Serializable> instead of getValue() returning String. Added MultilingualStringMapper.getStringValue() helper method. - Enum rename: AllVehicleModesOfTransportEnumeration renamed to AllPublicTransportModesEnumeration. - Collection getter naming: Some methods renamed with _Dummy suffix (e.g., getLine_Dummy(), getRoute_Dummy()). - PublicCode/PrivateCode: Now return structure types requiring .getValue() to get String. - StopPlacesInFrame_RelStructure: Now returns List<StopPlace> directly instead of wrapped JAXBElements. - DatedServiceJourney: getJourneyRef() returns single element instead of List, uses getReplacedJourneys() for replacements. - ServiceAlterationEnumeration: New PROVISIONAL value added, mapped to PLANNED. See: entur/netex-java-model#270
vpaturet
force-pushed
the
upgrade-netex-2.0
branch
from
August 13, 2026 10:56
1b280f1 to
440083c
Compare
vpaturet
force-pushed
the
upgrade-netex-2.0
branch
2 times, most recently
from
September 24, 2026 12:50
f687f07 to
2c96d99
Compare
vpaturet
added a commit
to entur/OpenTripPlanner
that referenced
this pull request
Sep 25, 2026
This update adapts OTP to the breaking changes in netex-java-model 3.0.0-SNAPSHOT based on the NeTEx 2.0 schema. Key changes include: Breaking API changes addressed: - MultilingualString: Uses mixed content model - getContent() returns List<Serializable> instead of getValue() returning String. Added MultilingualStringMapper.getStringValue() helper method. - Enum rename: AllVehicleModesOfTransportEnumeration renamed to AllPublicTransportModesEnumeration. - Collection getter naming: Some methods renamed with _Dummy suffix (e.g., getLine_Dummy(), getRoute_Dummy()). - PublicCode/PrivateCode: Now return structure types requiring .getValue() to get String. - StopPlacesInFrame_RelStructure: Now returns List<StopPlace> directly instead of wrapped JAXBElements. - DatedServiceJourney: getJourneyRef() returns single element instead of List, uses getReplacedJourneys() for replacements. - ServiceAlterationEnumeration: New PROVISIONAL value added, mapped to PLANNED. See: entur/netex-java-model#270
vpaturet
force-pushed
the
upgrade-netex-2.0
branch
from
September 25, 2026 07:46
dbd0bd0 to
b91e6c9
Compare
vpaturet
force-pushed
the
upgrade-netex-2.0
branch
from
October 13, 2026 09:06
591201d to
d66ac12
Compare
vpaturet
added a commit
to entur/OpenTripPlanner
that referenced
this pull request
Oct 13, 2026
The NeTEx 2.0 model is now published under new Maven coordinates, org.entur:netex2-java-model, with the generated model relocated from org.rutebanken.netex.model to org.entur.netex2.model. Adapt OTP to the additional breaking changes in the latest snapshot: - Maven coordinates and the version property renamed to netex2-java-model. - All imports moved to org.entur.netex2.model. - xs:date properties are now java.time.LocalDate instead of LocalDateTime at midnight: OperatingDay.calendarDate and DayTypeAssignment.date are consumed as LocalDate in OperatingDayMapper, TripPatternMapper and DayTypeAssignmentMapper. OperatingPeriod and ValidBetween keep LocalDateTime (xs:dateTime). See: entur/netex-java-model#270
This was referenced Oct 13, 2026
vpaturet
added a commit
to entur/antu
that referenced
this pull request
Oct 13, 2026
…r xs:date netex-java-model 3.0.0 is published as org.entur:netex2-java-model with the base package org.entur.netex2 (entur/netex-java-model#270), and the netex-parser-java 5.0.0 and netex-validator-java 13.0.0 snapshots now depend on it. Pin that artifact instead of the old one and move every import from org.rutebanken.netex.* to org.entur.netex2.*. The same release maps xs:date to LocalDate. OperatingDay.calendarDate and DayTypeAssignment.date are the two such fields antu reads; they are widened to midnight in ServiceJourneyActiveDatesCollector because NetexDataRepository in netex-validator-java and the report-scoped Redis caches keep LocalDateTime, so neither the repository contract nor the cache wire format changes. The test factory drops the opposite conversion it did for the 1.x model. OperatingPeriod from/to dates are xs:dateTime and are unchanged. The other breaking changes in that release (JPMS module name, typed enumeration properties, private NeTExValidator constructors, non-exported util package) touch nothing antu uses.
This was referenced Oct 13, 2026
vpaturet
added a commit
to entur/OpenTripPlanner
that referenced
this pull request
Oct 15, 2026
This update adapts OTP to the breaking changes in netex-java-model 3.0.0-SNAPSHOT based on the NeTEx 2.0 schema. Key changes include: Breaking API changes addressed: - MultilingualString: Uses mixed content model - getContent() returns List<Serializable> instead of getValue() returning String. Added MultilingualStringMapper.getStringValue() helper method. - Enum rename: AllVehicleModesOfTransportEnumeration renamed to AllPublicTransportModesEnumeration. - Collection getter naming: Some methods renamed with _Dummy suffix (e.g., getLine_Dummy(), getRoute_Dummy()). - PublicCode/PrivateCode: Now return structure types requiring .getValue() to get String. - StopPlacesInFrame_RelStructure: Now returns List<StopPlace> directly instead of wrapped JAXBElements. - DatedServiceJourney: getJourneyRef() returns single element instead of List, uses getReplacedJourneys() for replacements. - ServiceAlterationEnumeration: New PROVISIONAL value added, mapped to PLANNED. See: entur/netex-java-model#270
vpaturet
added a commit
to entur/OpenTripPlanner
that referenced
this pull request
Oct 15, 2026
The NeTEx 2.0 model is now published under new Maven coordinates, org.entur:netex2-java-model, with the generated model relocated from org.rutebanken.netex.model to org.entur.netex2.model. Adapt OTP to the additional breaking changes in the latest snapshot: - Maven coordinates and the version property renamed to netex2-java-model. - All imports moved to org.entur.netex2.model. - xs:date properties are now java.time.LocalDate instead of LocalDateTime at midnight: OperatingDay.calendarDate and DayTypeAssignment.date are consumed as LocalDate in OperatingDayMapper, TripPatternMapper and DayTypeAssignmentMapper. OperatingPeriod and ValidBetween keep LocalDateTime (xs:dateTime). See: entur/netex-java-model#270
- Update bindings.xjb for NeTEx 2.0 schema changes: - TariffZone_ renamed to TariffZone_Dummy - Remove obsolete HeadwayJourneyGroupGroup/Description binding - Add bindings to resolve ObjectFactory collisions for bookingArrangements - Update tests for NeTEx 2.0 API changes, including the regression tests added by #278 (Chouette/OTP/netex-validator-java use cases): - MultilingualString now uses mixed content (withContent/getContent) - Collection getters renamed with _Dummy suffix - StopPlacesInFrame returns List<StopPlace> directly - AllVehicleModesOfTransportEnumeration -> AllPublicTransportModesEnumeration - PublicCode/PrivateCode now use structure types - Replace removed DatedCall tests with AvailabilityCondition tests - Add helper method getStringValue() for MultilingualString - Build and publish snapshots with Java 21 in CI - Update the README to state NeTEx 2.0, Java 21 and the CEN schema source
The NeTEx GitHub repository moved from NeTEx-CEN/NeTEx to TransmodelEcosystem/NeTEx.
Adds module-info.java declaring org.entur.netex.java.model, replacing the Automatic-Module-Name manifest entry. requires transitive is used for jakarta.xml.bind, java.xml and org.apache.commons.lang3 since their types leak into the public API (JAXBException, QName/XMLGregorianCalendar, OmitNullsToStringStyle extends ToStringStyle). The generated model packages (org.rutebanken.netex.model, net.opengis.gml._3, uk.org.siri.siri) use field-level JAXB access, so they're opened to jakarta.xml.bind, org.glassfish.jaxb.runtime and org.apache.commons.lang3 - verified by running with each opens target removed until `mvn clean test` passed cleanly on the module path (Surefire auto-detects module-info.java and runs on the module path). Also renames org.rutebanken.util to org.rutebanken.netex.util for consistency with the other org.rutebanken.netex.* packages.
The NeTEx 2.0 model is published as a separate artifact so that it can coexist with the NeTEx 1.x model (org.entur:netex-java-model) on the same classpath.
The generated model now lives in org.entur.netex2.model and the hand-written utilities in org.entur.netex2, org.entur.netex2.client, org.entur.netex2.util and org.entur.netex2.validation. The JPMS module is renamed accordingly to org.entur.netex2 so that the module name matches its root package.
xsd:date elements (OperatingDay/CalendarDate, DayTypeAssignment/Date, ServiceCalendar/FromDate and ToDate, ...) were previously bound to LocalDateTime at midnight. They are now bound to LocalDate. LocalDateXmlAdapter accepts an optional trailing zone offset when unmarshalling, as permitted by xsd:date, and ignores it. Dates are always marshalled as yyyy-MM-dd. xsd:dateTime elements are still bound to LocalDateTime.
The 1.16.1 schema is only reachable through v1_16, which validates against it. The deprecated constant was added for the 2.0.16.x hotfixes and is not needed in the 3.0 API.
The manual release and hotfix workflows still set up Java 11, but the enforcer plugin now requires Java 21.
The pin existed because JUnit 6 requires Java 17 and the library targeted Java 11. The baseline is now Java 21.
Use the new artifact name as title, state the actual range of legacy validation schemas, credit threeten-jaxb-core only for Duration, and mention the SIRI package and the JPMS module name.
CXF XJC 4.1.x bundles JAXB RI 4.0.6, which generates xsd:list and simple-typed properties with an enumeration type as that enumeration instead of String (JAXB RI #1819). This was pinned on the 2.x line to avoid a source-incompatible change in a patch release; 3.0 is a breaking release, so the type-safe enums are adopted here. 4.2.0 is a dependency-bump release over 4.1.3 with the same JAXB RI 4.0.7 and generates the same model. Generated API changes: - PropertyOfDayStructure.weeksOfMonth: List<String> -> List<WeekOfMonthEnumeration> - RechargingEquipmentProfile_VersionStructure.currentType: String -> CurrentTypeEnumeration - VehicleChargingEquipment_VersionStructure.currentType: String -> CurrentTypeEnumeration - New enums CurrentTypeEnumeration, WeekOfMonthEnumeration, WeeksOfMonthEnumeration
The generated code references nothing under org.apache.cxf: the toString plugin uses OmitNullsToStringStyle from this library. The runtime-scoped jar was only leaked to consumers.
The adapters in this package are referenced by the generated model and instantiated reflectively by the JAXB runtime; nothing else needs them.
Instances are cached per version and obtained through the static getNeTExValidator methods, which the constructor Javadoc already asked callers to use.
OmitNullsToStringStyle is only passed by the generated toString() methods to commons-lang3, which calls it through the ToStringStyle type. No module needs the package exported.
Releases and snapshots are published by JReleaser through the GitHub workflows. The jfrog snapshot repository, the wagon-ssh-external extension, the maven-release-plugin configuration (which referenced profiles that no longer exist) and the unused nexus-staging, gpg and dependency plugin version properties are left over from the previous release process. The sonar profile no longer redeclares jdk.version.
The build only removes the schema folders it is about to download again, so folders from earlier builds (1.15.x, 1.16) ended up in locally built jars.
- OmitNullsToStringStyle: annotate serialVersionUID with @serial - LocalTimeISO8601XmlAdapter: Javadoc paragraph break instead of a blank line, which Javadoc ignores - FastLocalDateTimeParser: readDate always started at 0, so the start parameter is dropped; hasValidZoneSuffix was only ever called negated and is inverted into hasInvalidZoneSuffix
The style is only meant to be used through INSTANCE. This also removes the javac this-escape warning about the overridable setters called from the constructor.
- Replace the 32 string-literal concatenations of XML documents with text blocks (S6126). Trailing spaces inside the documents are kept with \s so the values are unchanged. - Stream.toList() instead of collect(Collectors.toList()) (S6204) - Drop redundant public modifiers from JUnit 5 test classes and methods (S5786) - NeTExValidatorTest: initialise the validator in @beforeeach instead of an empty constructor (S1186), name the XML constant in upper case (S115) and the local validator variable without digits (S117) - MarshalUnmarshalTest: remove an unused import (S1128) and a String.format with constant arguments (S9397)
parseDefaulting(OFFSET_SECONDS, <JVM default offset at class load>) had no effect: LocalDateTime.from and LocalTime.from never read the offset, so an offset in the input is ignored whether it is present, absent or defaulted. Parsing and formatting results are unchanged. The adapters now document that behaviour, as LocalDateXmlAdapter already did.
maven-release-plugin, buildnumber-maven-plugin and maven-shade-plugin are not used, so their backup and output files never appear.
Java 21 SequencedCollection accessor, as suggested by IntelliJ.
NeTEx 2.0 names its abstract substitution-group heads with a _Dummy suffix (DayType_Dummy is the head of DayType), where 1.x used a trailing underscore. xjc leaked the suffix into the generated API as getDayType_Dummy(), getDayTypeRefOrDayType_Dummy(), createDayType_Dummy() and classes such as MediumAccessDevice_Dummy. Add bin/generate-dummy-bindings.py, which derives one JAXB binding per leak from the schema and writes them into a marked block of bindings.xjb: properties drop the suffix (getDayType(), getDayTypeRefOrDayType()), while factory methods and the few classes generated for heads keep a trailing underscore as in netex-java-model 2.x (createDayType_(), MediumAccessDevice_), since dropping it there collides with the factory method of the concrete element. The hand-written TariffZone binding is covered by the generated block. Tests and docs are updated accordingly.
vpaturet
force-pushed
the
upgrade-netex-2.0
branch
from
October 15, 2026 12:25
3517adc to
918e526
Compare
|
vpaturet
added a commit
to entur/OpenTripPlanner
that referenced
this pull request
Oct 16, 2026
This update adapts OTP to the breaking changes in netex-java-model 3.0.0-SNAPSHOT based on the NeTEx 2.0 schema. Key changes include: Breaking API changes addressed: - MultilingualString: Uses mixed content model - getContent() returns List<Serializable> instead of getValue() returning String. Added MultilingualStringMapper.getStringValue() helper method. - Enum rename: AllVehicleModesOfTransportEnumeration renamed to AllPublicTransportModesEnumeration. - Collection getter naming: Some methods renamed with _Dummy suffix (e.g., getLine_Dummy(), getRoute_Dummy()). - PublicCode/PrivateCode: Now return structure types requiring .getValue() to get String. - StopPlacesInFrame_RelStructure: Now returns List<StopPlace> directly instead of wrapped JAXBElements. - DatedServiceJourney: getJourneyRef() returns single element instead of List, uses getReplacedJourneys() for replacements. - ServiceAlterationEnumeration: New PROVISIONAL value added, mapped to PLANNED. See: entur/netex-java-model#270
vpaturet
added a commit
to entur/OpenTripPlanner
that referenced
this pull request
Oct 16, 2026
The NeTEx 2.0 model is now published under new Maven coordinates, org.entur:netex2-java-model, with the generated model relocated from org.rutebanken.netex.model to org.entur.netex2.model. Adapt OTP to the additional breaking changes in the latest snapshot: - Maven coordinates and the version property renamed to netex2-java-model. - All imports moved to org.entur.netex2.model. - xs:date properties are now java.time.LocalDate instead of LocalDateTime at midnight: OperatingDay.calendarDate and DayTypeAssignment.date are consumed as LocalDate in OperatingDayMapper, TripPatternMapper and DayTypeAssignmentMapper. OperatingPeriod and ValidBetween keep LocalDateTime (xs:dateTime). See: entur/netex-java-model#270
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Summary
Upgrade the NeTEx schema from version 1.16 to 2.0 and publish the result as a new artifact,
org.entur:netex2-java-model, with a new base package,org.entur.netex2, so that it can live side by side withnetex-java-model2.x in the same application. The jar is also a JPMS module (merged in from #301), andxs:dateis now mapped tojava.time.LocalDate.This lands as 3.0.0 (
3.0.0-SNAPSHOT), continuing the version numbering ofnetex-java-modeleven though the artifactId changes.Breaking changes
org.entur:netex-java-model→org.entur:netex2-java-model. Release and hotfix workflow summaries, the README badges and the usage snippets point to the new artifact.org.rutebanken.*→org.entur.netex2.*:org.rutebanken.netex.model→org.entur.netex2.modelorg.rutebanken.util→org.entur.netex2.util(LocalDateTimeISO8601XmlAdapter,LocalDateXmlAdapter,LocalTimeISO8601XmlAdapter,VersionXmlAdapter)org.rutebanken.netex.OmitNullsToStringStyle,org.rutebanken.netex.client.PublicationDeliveryClient,org.rutebanken.netex.validation.NeTExValidator→org.entur.netex2.{,client,validation}net.opengis.gml._3,uk.org.siri.siri(see "Side-by-side use" below).org.entur.netex.java.model(theAutomatic-Module-Nameof 2.x) →org.entur.netex2, now declared inmodule-info.java. Consumers with amodule-info.javamust update theirrequires.jdk.version; CI builds and publishes with Java 21).xs:dateis mapped tojava.time.LocalDateinstead ofLocalDateTimeat midnight. This changes the type of 28 properties across 18 generated classes, e.g.OperatingDay.calendarDate,DayTypeAssignment.date,ServiceCalendar.fromDate/toDate,UsageValidityPeriod.startDate/endDate,Vehicle.registrationDate.xs:dateTimeis stillLocalDateTime. The new adapter accepts and ignores an optional time zone offset on input (2026-05-03+02:00,2026-05-03Z), always writesyyyy-MM-dd, and no longer depends on the JVM's default offset.String. CXF XJC is upgraded from 4.0.2 to 4.2.0. 4.1.x moved to JAXB RI 4.0.6+ which fixes JAXB RI #1819; 4.2.0 is a dependency-bump release with the same JAXB RI 4.0.7 as 4.1.3 and generates an identical model. The 2.x line pinned 4.0.x to avoid this in a patch release. Affected properties:PropertyOfDayStructure.weeksOfMonth:List<String>→List<WeekOfMonthEnumeration>RechargingEquipmentProfile_VersionStructure.currentTypeandVehicleChargingEquipment_VersionStructure.currentType:String→CurrentTypeEnumerationCurrentTypeEnumeration,WeekOfMonthEnumerationandWeeksOfMonthEnumeration. No other generated field or method signature changes.NeTExValidatorcan no longer be constructed directly. Both constructors are private; useNeTExValidator.getNeTExValidator()orgetNeTExValidator(NetexVersion), which cache one validator per version.org.entur.netex2.utilis exported only to the JAXB modules (jakarta.xml.bind,org.glassfish.jaxb.core,org.glassfish.jaxb.runtime) andorg.entur.netex2is not exported at all. The XML adapters andOmitNullsToStringStyleare implementation details of the generated model. Consumers on the classpath are unaffected; consumers on the module path can no longerimportthem.OmitNullsToStringStyleis alsofinalwith a private constructor; useOmitNullsToStringStyle.INSTANCE.cxf-xjc-runtimetransitive dependency is gone. The generated code never referenced it (the toString plugin uses this library's ownOmitNullsToStringStyle), so it was only leaked to consumers. The remaining runtime dependencies arejakarta.xml.bind-api,threeten-jaxb-core,jaxb-runtime,slf4j-apiandcommons-lang3.Side-by-side use with
netex-java-model2.xnet.opengis.gml._3anduk.org.siri.siri, which is a split package and is rejected at module resolution. See open questions.Changes
NeTEx 2.0 schema
TransmodelEcosystem/NeTExrepository (tagv2.0, previouslyentur/NeTExmaster). The legacy schemas used for validation (1.08 - 1.15) are still downloaded from the Entur fork.JAXB Bindings (bindings.xjb)
xs:date→java.time.LocalDateviaLocalDateXmlAdapter(rewritten; see breaking change 5)org.entur.netex2.*TariffZone_→TariffZone_Dummy(renamed in 2.0)HeadwayJourneyGroupGroup/Descriptionbinding (element removed in 2.0)bookingArrangementsvsBookingArrangementsin multiple XSD files|characterJPMS module (from #301)
module org.entur.netex2withrequires transitiveonjakarta.xml.bind,java.xmlandorg.apache.commons.lang3, because their types are part of the public API (JAXBException,QName/XMLGregorianCalendaronNeTExValidator,OmitNullsToStringStyle extends ToStringStyle).org.entur.netex2.model,net.opengis.gml._3,uk.org.siri.siri) are opened tojakarta.xml.bind,org.glassfish.jaxb.runtimeandorg.apache.commons.lang3. JAXB field access and the reflectivetoString()both need this.org.entur.netex2.utilis exported only to the JAXB modules andorg.entur.netex2is not exported (breaking change 9). Surefire runs the tests on the module path, so this is covered by the test suite.Automatic-Module-Namemanifest entry is removed.