https://github.com/entur/gbfs-java-model
https://github.com/entur/gbfs-java-model
ror
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/entur/gbfs-java-model
- Owner: entur
- Archived: true
- Created: 2021-04-07T13:48:27.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-14T10:33:33.000Z (11 months ago)
- Last Synced: 2025-03-13T08:41:39.820Z (10 months ago)
- Topics: ror
- Language: Java
- Homepage:
- Size: 237 KB
- Stars: 4
- Watchers: 5
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gbfs-java-model (deprecated)
## RELOCATION NOTICE
This package has been relocated to https://github.com/MobilityData/gbfs-json-schema/tree/master/models/java
In maven you will find the package under org.mobilitydata.gbfs-java-model from version 1.0.6.
## END RELOCATION NOTICE
Generates Java model from GBFS json schema using jsonschema2pojo with jackson2 annotations.
In order to avoid naming conflicts in generated classes, each feed gets its own package, and all
classes are prefixed with "GBFS".
Packages include GBFS versions to accommodate for future releases which may include older versions,
since some consumers may need to handle multiple non-compatible versions in the same application
(i.e. you should be able to parse v2.1 feeds with the v2.2 package, but v3.0 package would not
be able to parse v2.2 feeds).
### Special cases: in v2.x
Note: This does not apply to v3.0
#### gbfs.json
There is no support in jsonschema2pojo to handle "patternProperties" sanely, it will just result
in a class without any properties. The `gbfs.json` feed uses "patternProperties" for the `data`
property to define an object per language, where the language code is the name of the property.
The generated Gbfs class is therefore extended by
[src/main/org/entur/gbfs/v2_2/gbfs/GBFS.java](src/main/org/entur/gbfs/v2_2/gbfs/GBFS.java)
to override the `data` property with a Map implementation. This extended class should be used
when unmarshalling the `gbfs.json` feed.
#### station_information.json
In v2.x the properties `vehicle_capacity` and `vehicle_type_capacity` in `station_information`, are objects
whose keys are vehicle type ids. The generated classes for these properties are `GBFSVehicleCapacity` and
`GBFSVehicleTypeCapacity` respectively. To mapped key-value pairs can be accessed via the property `additionalProperties`
of these generated classes.
## Maven central
This project is available in the central maven repository.
See https://search.maven.org/search?q=g:org.entur.gbfs