MobilityData / gbfs-json-schema

JSON Schema for GBFS feeds, managed by MobilityData. The versions are organized by folders. CC BY 4.0
Apache License 2.0
23 stars 25 forks source link

Feat/116 java model name change #117

Closed Alessandro100 closed 4 months ago

Alessandro100 commented 4 months ago

For the Java Language binding, updated the path name to include the gbfs file name in the package. This will be available in gbfs-java-model@1.0.5 #116

old

import org.mobilitydata.gbfs.v3_0.GBFSVehicleStatus

new

import org.mobilitydata.gbfs.v3_0.vehicle_status.GBFSVehicleStatus

Changes

Screenshot 2024-05-16 at 13 54 55

Something to note

Imports such as

import org.mobilitydata.gbfs.v2_2.vehicle_types.GBFSData;
import org.mobilitydata.gbfs.v2_2.system_alerts.GBFSData;
import org.mobilitydata.gbfs.v3_0.vehicle_types.GBFSData;

will have naming collisions. Some jvm languages such as Groovy support naming aliasing but default Java does not. I know there is always the options to do

org.entur.gbfs.v3_0.vehicle_types.GBFSData variableName;

to avoid name conflicts but I'm wondering if there are another solutions 🤔

Alessandro100 commented 4 months ago

@testower I'm on the same page for vehicle_types.GBFSData being more clear than GBFS_1, just trying to consider name collisions

Heads up the new version is published on Maven Central as 1.0.6 🎉