From 89a6b149ebac7c023853edf9e1e4156835a2f7a3 Mon Sep 17 00:00:00 2001 From: Samuel Cedarbaum Date: Mon, 16 Oct 2023 21:29:03 -0400 Subject: [PATCH 1/3] Expose rental station vehicle/space availability per vehicle type --- .../VehicleRentalStationImpl.java | 15 +++- .../gtfs/generated/GraphQLDataFetchers.java | 6 ++ .../apis/gtfs/generated/graphql-codegen.yml | 2 + .../model/RentalVehicleEntityCounts.java | 5 ++ .../model/RentalVehicleTypeCount.java | 3 + .../model/VehicleRentalStation.java | 32 ++++++++ .../opentripplanner/apis/gtfs/schema.graphqls | 30 ++++++- .../apis/gtfs/GraphQLIntegrationTest.java | 13 ++- .../DefaultVehicleRentalServiceTest.java | 3 +- .../TestVehicleRentalStationBuilder.java | 79 ++++++++++++++----- .../street/search/state/TestStateBuilder.java | 4 +- .../expectations/vehicle-rental-station.json | 59 ++++++++++++++ .../queries/vehicle-rental-station.graphql | 43 ++++++++++ 13 files changed, 264 insertions(+), 30 deletions(-) create mode 100644 src/main/java/org/opentripplanner/service/vehiclerental/model/RentalVehicleEntityCounts.java create mode 100644 src/main/java/org/opentripplanner/service/vehiclerental/model/RentalVehicleTypeCount.java create mode 100644 src/test/resources/org/opentripplanner/apis/gtfs/expectations/vehicle-rental-station.json create mode 100644 src/test/resources/org/opentripplanner/apis/gtfs/queries/vehicle-rental-station.graphql diff --git a/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/VehicleRentalStationImpl.java b/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/VehicleRentalStationImpl.java index c1256f15c3f..dc60a7c76e8 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/VehicleRentalStationImpl.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/VehicleRentalStationImpl.java @@ -4,7 +4,8 @@ import graphql.schema.DataFetcher; import graphql.schema.DataFetchingEnvironment; import org.opentripplanner.apis.gtfs.generated.GraphQLDataFetchers; -import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; +import org.opentripplanner.service.vehiclerental.model.RentalVehicleEntityCounts; +import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; import org.opentripplanner.service.vehiclerental.model.VehicleRentalStationUris; public class VehicleRentalStationImpl implements GraphQLDataFetchers.GraphQLVehicleRentalStation { @@ -96,7 +97,17 @@ public DataFetcher vehiclesAvailable() { return environment -> getSource(environment).getVehiclesAvailable(); } - private VehicleRentalPlace getSource(DataFetchingEnvironment environment) { + @Override + public DataFetcher availableVehicles() { + return environment -> getSource(environment).getVehicleTypeCounts(); + } + + @Override + public DataFetcher availableSpaces() { + return environment -> getSource(environment).getVehicleSpaceCounts(); + } + + private VehicleRentalStation getSource(DataFetchingEnvironment environment) { return environment.getSource(); } } diff --git a/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java b/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java index 8f2013f75af..b31dac0ea8e 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java +++ b/src/main/java/org/opentripplanner/apis/gtfs/generated/GraphQLDataFetchers.java @@ -48,7 +48,9 @@ import org.opentripplanner.routing.vehicle_parking.VehicleParkingState; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle.StopRelationship; +import org.opentripplanner.service.vehiclerental.model.RentalVehicleEntityCounts; import org.opentripplanner.service.vehiclerental.model.RentalVehicleType; +import org.opentripplanner.service.vehiclerental.model.RentalVehicleTypeCount; import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace; import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; import org.opentripplanner.service.vehiclerental.model.VehicleRentalStationUris; @@ -1181,6 +1183,10 @@ public interface GraphQLVehicleRentalStation { public DataFetcher stationId(); public DataFetcher vehiclesAvailable(); + + public DataFetcher availableVehicles(); + + public DataFetcher availableSpaces(); } public interface GraphQLVehicleRentalUris { diff --git a/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml b/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml index 1f5341558c2..ed5726b9bb3 100644 --- a/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml +++ b/src/main/java/org/opentripplanner/apis/gtfs/generated/graphql-codegen.yml @@ -38,6 +38,8 @@ config: BikeRentalStation: org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace#VehicleRentalPlace BikeRentalStationUris: org.opentripplanner.service.vehiclerental.model.VehicleRentalStationUris#VehicleRentalStationUris VehicleRentalStation: org.opentripplanner.service.vehiclerental.model.VehicleRentalStation#VehicleRentalStation + RentalVehicleEntityCounts: org.opentripplanner.service.vehiclerental.model.RentalVehicleEntityCounts#RentalVehicleEntityCounts + RentalVehicleTypeCount: org.opentripplanner.service.vehiclerental.model.RentalVehicleTypeCount#RentalVehicleTypeCount RentalVehicle: org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle#VehicleRentalVehicle VehicleRentalUris: org.opentripplanner.service.vehiclerental.model.VehicleRentalStationUris#VehicleRentalStationUris BikesAllowed: org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLBikesAllowed#GraphQLBikesAllowed diff --git a/src/main/java/org/opentripplanner/service/vehiclerental/model/RentalVehicleEntityCounts.java b/src/main/java/org/opentripplanner/service/vehiclerental/model/RentalVehicleEntityCounts.java new file mode 100644 index 00000000000..a2ca78b4145 --- /dev/null +++ b/src/main/java/org/opentripplanner/service/vehiclerental/model/RentalVehicleEntityCounts.java @@ -0,0 +1,5 @@ +package org.opentripplanner.service.vehiclerental.model; + +import java.util.List; + +public record RentalVehicleEntityCounts(int total, List byType) {} diff --git a/src/main/java/org/opentripplanner/service/vehiclerental/model/RentalVehicleTypeCount.java b/src/main/java/org/opentripplanner/service/vehiclerental/model/RentalVehicleTypeCount.java new file mode 100644 index 00000000000..9aff8079f2c --- /dev/null +++ b/src/main/java/org/opentripplanner/service/vehiclerental/model/RentalVehicleTypeCount.java @@ -0,0 +1,3 @@ +package org.opentripplanner.service.vehiclerental.model; + +public record RentalVehicleTypeCount(RentalVehicleType vehicleType, int count) {} diff --git a/src/main/java/org/opentripplanner/service/vehiclerental/model/VehicleRentalStation.java b/src/main/java/org/opentripplanner/service/vehiclerental/model/VehicleRentalStation.java index 2ced6b44909..a31e5e88a0e 100644 --- a/src/main/java/org/opentripplanner/service/vehiclerental/model/VehicleRentalStation.java +++ b/src/main/java/org/opentripplanner/service/vehiclerental/model/VehicleRentalStation.java @@ -3,6 +3,7 @@ import static java.util.Locale.ROOT; import java.time.Instant; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; @@ -188,4 +189,35 @@ public Set formFactors() { getAvailablePickupFormFactors(false) ); } + + /** + * @return Counts of available vehicles by type as well as the total number of available vehicles. + */ + public RentalVehicleEntityCounts getVehicleTypeCounts() { + return new RentalVehicleEntityCounts( + vehiclesAvailable, + vehicleRentalTypeMapToList(vehicleTypesAvailable) + ); + } + + /** + * @return Counts of available vehicle spaces by type as well as the total number of available + * vehicle spaces. + */ + public RentalVehicleEntityCounts getVehicleSpaceCounts() { + return new RentalVehicleEntityCounts( + spacesAvailable, + vehicleRentalTypeMapToList(vehicleSpacesAvailable) + ); + } + + private List vehicleRentalTypeMapToList( + Map vehicleTypeMap + ) { + return vehicleTypeMap + .entrySet() + .stream() + .map(vtc -> new RentalVehicleTypeCount(vtc.getKey(), vtc.getValue())) + .toList(); + } } diff --git a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls index 046e581af30..2dea139f6ea 100644 --- a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls +++ b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls @@ -558,7 +558,7 @@ type VehicleRentalStation implements Node & PlaceInterface { Number of vehicles currently available on the rental station. See field `allowPickupNow` to know if is currently possible to pick up a vehicle. """ - vehiclesAvailable: Int + vehiclesAvailable: Int @deprecated(reason: "Use availableVehicles instead, which also contains vehicle types") """ Number of free spaces currently available on the rental station. @@ -567,7 +567,17 @@ type VehicleRentalStation implements Node & PlaceInterface { the rental station, even if the vehicle racks don't have any spaces available. See field `allowDropoffNow` to know if is currently possible to return a vehicle. """ - spacesAvailable: Int + spacesAvailable: Int @deprecated(reason: "Use availableSpaces instead, which also contains the space vehicle types") + + """ + Number of vehicles currently available on the rental station, grouped by vehicle type. + """ + availableVehicles: RentalVehicleEntityCounts! + + """ + Number of free spaces currently available on the rental station, grouped by vehicle type. + """ + availableSpaces: RentalVehicleEntityCounts! """ If true, values of `vehiclesAvailable` and `spacesAvailable` are updated from a @@ -617,6 +627,22 @@ type VehicleRentalStation implements Node & PlaceInterface { operative: Boolean } +type RentalVehicleEntityCounts { + """The total number of entities (e.g. vehicles, spaces).""" + total: Int! + + """The number of entities by type""" + byType: [RentalVehicleTypeCount!]! +} + +type RentalVehicleTypeCount { + """The type of the rental vehicle (scooter, bicycle, car...)""" + vehicleType: RentalVehicleType! + + """The number of vehicles of this type""" + count: Int! +} + """ Rental vehicle represents a vehicle that belongs to a rental network. """ diff --git a/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java b/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java index c1e0d0bbccb..010fdc1adc6 100644 --- a/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java +++ b/src/test/java/org/opentripplanner/apis/gtfs/GraphQLIntegrationTest.java @@ -73,6 +73,8 @@ import org.opentripplanner.service.realtimevehicles.internal.DefaultRealtimeVehicleService; import org.opentripplanner.service.realtimevehicles.model.RealtimeVehicle; import org.opentripplanner.service.vehiclerental.internal.DefaultVehicleRentalService; +import org.opentripplanner.service.vehiclerental.model.TestVehicleRentalStationBuilder; +import org.opentripplanner.service.vehiclerental.model.VehicleRentalStation; import org.opentripplanner.standalone.config.framework.json.JsonSupport; import org.opentripplanner.test.support.FilePatternSource; import org.opentripplanner.transit.model._data.TransitModelForTest; @@ -241,13 +243,22 @@ public TransitAlertService getTransitAlertService() { .build(); realtimeVehicleService.setRealtimeVehicles(pattern, List.of(occypancyVehicle, positionVehicle)); + DefaultVehicleRentalService defaultVehicleRentalService = new DefaultVehicleRentalService(); + VehicleRentalStation vehicleRentalStation = new TestVehicleRentalStationBuilder() + .withVehicles(10) + .withSpaces(10) + .withVehicleTypeBicycle(5, 7) + .withVehicleTypeElectricBicycle(5, 3) + .build(); + defaultVehicleRentalService.addVehicleRentalStation(vehicleRentalStation); + context = new GraphQLRequestContext( new TestRoutingService(List.of(i1)), transitService, new DefaultFareService(), graph.getVehicleParkingService(), - new DefaultVehicleRentalService(), + defaultVehicleRentalService, realtimeVehicleService, GraphFinder.getInstance(graph, transitService::findRegularStop), new RouteRequest() diff --git a/src/test/java/org/opentripplanner/service/vehiclerental/internal/DefaultVehicleRentalServiceTest.java b/src/test/java/org/opentripplanner/service/vehiclerental/internal/DefaultVehicleRentalServiceTest.java index f193b65d986..0a7cfd568aa 100644 --- a/src/test/java/org/opentripplanner/service/vehiclerental/internal/DefaultVehicleRentalServiceTest.java +++ b/src/test/java/org/opentripplanner/service/vehiclerental/internal/DefaultVehicleRentalServiceTest.java @@ -17,8 +17,7 @@ void getVehicleRentalStationForEnvelopeShouldExcludeVehicleRentalVehicle() { DefaultVehicleRentalService defaultVehicleRentalService = new DefaultVehicleRentalService(); VehicleRentalStation vehicleRentalStation = new TestVehicleRentalStationBuilder() - .withLatitude(1) - .withLongitude(1) + .withCoordinates(1, 1) .build(); defaultVehicleRentalService.addVehicleRentalStation(vehicleRentalStation); diff --git a/src/test/java/org/opentripplanner/service/vehiclerental/model/TestVehicleRentalStationBuilder.java b/src/test/java/org/opentripplanner/service/vehiclerental/model/TestVehicleRentalStationBuilder.java index 4557be813d5..33f922ff0b9 100644 --- a/src/test/java/org/opentripplanner/service/vehiclerental/model/TestVehicleRentalStationBuilder.java +++ b/src/test/java/org/opentripplanner/service/vehiclerental/model/TestVehicleRentalStationBuilder.java @@ -1,5 +1,6 @@ package org.opentripplanner.service.vehiclerental.model; +import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; import org.opentripplanner.framework.i18n.NonLocalizedString; @@ -18,18 +19,15 @@ public class TestVehicleRentalStationBuilder { private int spaces = 10; private boolean overloadingAllowed = false; private boolean stationOn = false; - private RentalVehicleType vehicleType = RentalVehicleType.getDefaultType(NETWORK_1); + private final Map vehicleTypesAvailable = new HashMap<>(); + private final Map vehicleSpacesAvailable = new HashMap<>(); public static TestVehicleRentalStationBuilder of() { return new TestVehicleRentalStationBuilder(); } - public TestVehicleRentalStationBuilder withLatitude(double latitude) { + public TestVehicleRentalStationBuilder withCoordinates(double latitude, double longitude) { this.latitude = latitude; - return this; - } - - public TestVehicleRentalStationBuilder withLongitude(double longitude) { this.longitude = longitude; return this; } @@ -54,24 +52,55 @@ public TestVehicleRentalStationBuilder withStationOn(boolean stationOn) { return this; } - public TestVehicleRentalStationBuilder withVehicleTypeBicycle() { - return buildVehicleType(RentalFormFactor.BICYCLE); + public TestVehicleRentalStationBuilder withVehicleTypeBicycle(int numAvailable, int numSpaces) { + return buildVehicleType( + RentalFormFactor.BICYCLE, + RentalVehicleType.PropulsionType.HUMAN, + numAvailable, + numSpaces + ); } - public TestVehicleRentalStationBuilder withVehicleTypeCar() { - return buildVehicleType(RentalFormFactor.CAR); + public TestVehicleRentalStationBuilder withVehicleTypeElectricBicycle( + int numAvailable, + int numSpaces + ) { + return buildVehicleType( + RentalFormFactor.BICYCLE, + RentalVehicleType.PropulsionType.ELECTRIC, + numAvailable, + numSpaces + ); + } + + public TestVehicleRentalStationBuilder withVehicleTypeCar(int numAvailable, int numSpaces) { + return buildVehicleType( + RentalFormFactor.CAR, + RentalVehicleType.PropulsionType.ELECTRIC, + numAvailable, + numSpaces + ); } @Nonnull - private TestVehicleRentalStationBuilder buildVehicleType(RentalFormFactor rentalFormFactor) { - this.vehicleType = - new RentalVehicleType( - new FeedScopedId(TestVehicleRentalStationBuilder.NETWORK_1, rentalFormFactor.name()), - rentalFormFactor.name(), - rentalFormFactor, - RentalVehicleType.PropulsionType.ELECTRIC, - 100000d - ); + private TestVehicleRentalStationBuilder buildVehicleType( + RentalFormFactor rentalFormFactor, + RentalVehicleType.PropulsionType propulsionType, + int numAvailable, + int numSpaces + ) { + RentalVehicleType vehicleType = new RentalVehicleType( + new FeedScopedId( + TestVehicleRentalStationBuilder.NETWORK_1, + String.format("%s-%s", rentalFormFactor.name(), propulsionType.name()) + ), + rentalFormFactor.name(), + rentalFormFactor, + propulsionType, + 100000d + ); + this.vehicleTypesAvailable.put(vehicleType, numAvailable); + this.vehicleSpacesAvailable.put(vehicleType, numSpaces); return this; } @@ -84,8 +113,16 @@ public VehicleRentalStation build() { station.longitude = longitude; station.vehiclesAvailable = vehicles; station.spacesAvailable = spaces; - station.vehicleTypesAvailable = Map.of(vehicleType, vehicles); - station.vehicleSpacesAvailable = Map.of(vehicleType, spaces); + + // If no vehicle types are specified, use the default type + if (vehicleTypesAvailable.isEmpty() || vehicleSpacesAvailable.isEmpty()) { + station.vehicleTypesAvailable = Map.of(RentalVehicleType.getDefaultType(NETWORK_1), vehicles); + station.vehicleSpacesAvailable = Map.of(RentalVehicleType.getDefaultType(NETWORK_1), spaces); + } else { + station.vehicleTypesAvailable = vehicleTypesAvailable; + station.vehicleSpacesAvailable = vehicleSpacesAvailable; + } + station.overloadingAllowed = overloadingAllowed; station.isRenting = stationOn; station.isReturning = stationOn; diff --git a/src/test/java/org/opentripplanner/street/search/state/TestStateBuilder.java b/src/test/java/org/opentripplanner/street/search/state/TestStateBuilder.java index 9a65e670370..91c390932a8 100644 --- a/src/test/java/org/opentripplanner/street/search/state/TestStateBuilder.java +++ b/src/test/java/org/opentripplanner/street/search/state/TestStateBuilder.java @@ -117,7 +117,7 @@ public TestStateBuilder streetEdge() { public TestStateBuilder pickUpCarFromStation() { return pickUpRentalVehicle( RentalFormFactor.CAR, - TestVehicleRentalStationBuilder.of().withVehicleTypeCar().build() + TestVehicleRentalStationBuilder.of().withVehicleTypeCar(10, 10).build() ); } @@ -138,7 +138,7 @@ public TestStateBuilder pickUpFreeFloatingScooter() { public TestStateBuilder pickUpBikeFromStation() { return pickUpRentalVehicle( RentalFormFactor.BICYCLE, - TestVehicleRentalStationBuilder.of().withVehicleTypeBicycle().build() + TestVehicleRentalStationBuilder.of().withVehicleTypeElectricBicycle(10, 10).build() ); } diff --git a/src/test/resources/org/opentripplanner/apis/gtfs/expectations/vehicle-rental-station.json b/src/test/resources/org/opentripplanner/apis/gtfs/expectations/vehicle-rental-station.json new file mode 100644 index 00000000000..ef1284c5c5e --- /dev/null +++ b/src/test/resources/org/opentripplanner/apis/gtfs/expectations/vehicle-rental-station.json @@ -0,0 +1,59 @@ +{ + "data" : { + "vehicleRentalStation" : { + "stationId" : "Network-1:FooStation", + "name" : "FooStation", + "vehiclesAvailable" : 10, + "availableVehicles" : { + "byType" : [ + { + "vehicleType" : { + "formFactor" : "BICYCLE", + "propulsionType" : "ELECTRIC" + }, + "count" : 5 + }, + { + "vehicleType" : { + "formFactor" : "BICYCLE", + "propulsionType" : "HUMAN" + }, + "count" : 5 + } + ], + "total" : 10 + }, + "spacesAvailable" : 10, + "availableSpaces" : { + "byType" : [ + { + "vehicleType" : { + "formFactor" : "BICYCLE", + "propulsionType" : "ELECTRIC" + }, + "count" : 3 + }, + { + "vehicleType" : { + "formFactor" : "BICYCLE", + "propulsionType" : "HUMAN" + }, + "count" : 7 + } + ], + "total" : 10 + }, + "allowDropoff" : false, + "allowPickup" : false, + "allowDropoffNow" : false, + "allowPickupNow" : false, + "network" : "Network-1", + "lon" : 18.99, + "lat" : 47.51, + "capacity" : null, + "allowOverloading" : false, + "rentalUris" : null, + "operative" : false + } + } +} diff --git a/src/test/resources/org/opentripplanner/apis/gtfs/queries/vehicle-rental-station.graphql b/src/test/resources/org/opentripplanner/apis/gtfs/queries/vehicle-rental-station.graphql new file mode 100644 index 00000000000..8e555ffdbdd --- /dev/null +++ b/src/test/resources/org/opentripplanner/apis/gtfs/queries/vehicle-rental-station.graphql @@ -0,0 +1,43 @@ +{ + vehicleRentalStation(id: "Network-1:FooStation") { + stationId + name + vehiclesAvailable + availableVehicles { + byType { + vehicleType { + formFactor + propulsionType + } + count + } + total + } + spacesAvailable + availableSpaces { + byType { + vehicleType { + formFactor + propulsionType + } + count + } + total + } + allowDropoff + allowPickup + allowDropoffNow + allowPickupNow + network + lon + lat + capacity + allowOverloading + rentalUris { + android + ios + web + } + operative + } +} From 8df18db87437a8f588b817843b08f6b9328c5386 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Tue, 24 Oct 2023 14:08:51 +0200 Subject: [PATCH 2/3] Use backticks to prettify generated documentation --- .../resources/org/opentripplanner/apis/gtfs/schema.graphqls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls index 2dea139f6ea..7f23b30914f 100644 --- a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls +++ b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls @@ -558,7 +558,7 @@ type VehicleRentalStation implements Node & PlaceInterface { Number of vehicles currently available on the rental station. See field `allowPickupNow` to know if is currently possible to pick up a vehicle. """ - vehiclesAvailable: Int @deprecated(reason: "Use availableVehicles instead, which also contains vehicle types") + vehiclesAvailable: Int @deprecated(reason: "Use `availableVehicles` instead, which also contains vehicle types") """ Number of free spaces currently available on the rental station. @@ -567,7 +567,7 @@ type VehicleRentalStation implements Node & PlaceInterface { the rental station, even if the vehicle racks don't have any spaces available. See field `allowDropoffNow` to know if is currently possible to return a vehicle. """ - spacesAvailable: Int @deprecated(reason: "Use availableSpaces instead, which also contains the space vehicle types") + spacesAvailable: Int @deprecated(reason: "Use `availableSpaces` instead, which also contains the space vehicle types") """ Number of vehicles currently available on the rental station, grouped by vehicle type. From 85753600ecce50a9fe0623d6e9631381215249fb Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Thu, 26 Oct 2023 16:41:39 +0200 Subject: [PATCH 3/3] Make fields nullable --- .../resources/org/opentripplanner/apis/gtfs/schema.graphqls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls index 7f23b30914f..82d297abe96 100644 --- a/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls +++ b/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls @@ -572,12 +572,12 @@ type VehicleRentalStation implements Node & PlaceInterface { """ Number of vehicles currently available on the rental station, grouped by vehicle type. """ - availableVehicles: RentalVehicleEntityCounts! + availableVehicles: RentalVehicleEntityCounts """ Number of free spaces currently available on the rental station, grouped by vehicle type. """ - availableSpaces: RentalVehicleEntityCounts! + availableSpaces: RentalVehicleEntityCounts """ If true, values of `vehiclesAvailable` and `spacesAvailable` are updated from a