Skip to content

Commit

Permalink
fix(swagger): Fix wrong endpoint naming
Browse files Browse the repository at this point in the history
The spring-boot openapi package handles the naming of endpoints differently and the api-tests fail with the current naming. This is fixed now.
  • Loading branch information
MichaelsJP committed Apr 3, 2023
1 parent 8b842b0 commit e713c0d
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import java.util.List;

@Schema(name = "Centrality Service", description = "The JSON body request sent to the centrality service which defines options and parameters regarding the centrality measure to calculate.")
@Schema(title = "Centrality Service", name = "dentralityService", description = "The JSON body request sent to the centrality service which defines options and parameters regarding the centrality measure to calculate.")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class CentralityRequest extends APIRequest {
public static final String PARAM_BBOX = "bbox";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import java.util.List;

@Schema(name = "Centrality Service", description = "The JSON body request sent to the centrality service which defines options and parameters regarding the centrality measure to calculate.")
@Schema(title = "Graph export Service", name = "graphExportService", description = "Graph export service endpoint.")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class ExportRequest extends APIRequest {
public static final String PARAM_ID = "id";
Expand All @@ -40,7 +40,7 @@ public class ExportRequest extends APIRequest {

@Schema(name= PARAM_BBOX, description = "The bounding box to use for the request as an array of `longitude/latitude` pairs",
example = "[8.681495,49.41461,8.686507,49.41943]",
required = true)
requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty(PARAM_BBOX)
private List<List<Double>> bbox; //apparently, this has to be a non-primitive type…

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class MatrixRequest extends APIRequest {

@Schema(name = PARAM_LOCATIONS, description = "List of comma separated lists of `longitude,latitude` coordinates in WGS 84 (EPSG:4326)",
example = "[[9.70093, 48.477473], [9.207916, 49.153868], [37.573242, 55.801281], [115.663757, 38.106467]]",
required = true)
requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty(PARAM_LOCATIONS)
private List<List<Double>> locations;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(name = "Profile Parameters", description = "Specifies additional routing parameters. For all profiles except `driving-car`.", subTypes = {RequestProfileParamsRestrictions.class, RequestProfileParamsWeightings.class})
@Schema(title = "Profile Parameters", name = "profileParameters", description = "Specifies additional routing parameters. For all profiles except `driving-car`.", subTypes = {RequestProfileParamsRestrictions.class, RequestProfileParamsWeightings.class})
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class RequestProfileParams {
public static final String PARAM_WEIGHTINGS = "weightings";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(name = "Profile Weightings", description = "Describe additional weightings to be applied to edges on the routing.")
@Schema(title = "Profile Weightings", name = "profileWeightings", description = "Describe additional weightings to be applied to edges on the routing.")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class RequestProfileParamsWeightings {
public static final String PARAM_STEEPNESS_DIFFICULTY = "steepness_difficulty";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.util.List;
import java.util.stream.Stream;

@Schema(name = "Directions Service", description = "The JSON body request sent to the routing service which defines options and parameters regarding the route to generate.")
@Schema(title = "Directions Service", name = "directionsService", description = "The JSON body request sent to the routing service which defines options and parameters regarding the route to generate.")
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class RouteRequest extends APIRequest {
public static final String PARAM_COORDINATES = "coordinates";
Expand Down Expand Up @@ -71,7 +71,7 @@ public class RouteRequest extends APIRequest {

@Schema(name= PARAM_COORDINATES, description = "The waypoints to use for the route as an array of `longitude/latitude` pairs in WGS 84 (EPSG:4326)",
example = "[[8.681495,49.41461],[8.686507,49.41943],[8.687872,49.420318]]",
required = true)
requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty(PARAM_COORDINATES)
private List<List<Double>> coordinates;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(name = "Alternative Routes", description = "Specifies whether alternative routes are computed, and parameters for the algorithm determining suitable alternatives.")
@Schema(title = "Alternative Routes", name = "alternativeRoutes", description = "Specifies whether alternative routes are computed, and parameters for the algorithm determining suitable alternatives.")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class RouteRequestAlternativeRoutes {
public static final String PARAM_TARGET_COUNT = "target_count";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import io.swagger.v3.oas.annotations.media.Schema;
import org.heigit.ors.api.requests.common.RequestOptions;

@Schema(name = "Route Options", description = "Advanced options for routing", subTypes = {RouteRequestAlternativeRoutes.class, RequestProfileParams.class, RouteRequestRoundTripOptions.class})
@Schema(title = "Route Options", name = "routeOptions", description = "Advanced options for routing", subTypes = {RouteRequestAlternativeRoutes.class, RequestProfileParams.class, RouteRequestRoundTripOptions.class})
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class RouteRequestOptions extends RequestOptions {
public static final String PARAM_ROUND_TRIP_OPTIONS = "round_trip";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(name = "Round Trip Route Options", description = "Specifies the parameters for generating round trip routes.")
@Schema(title = "Round Trip Route Options", name = "roundTripRouteOptions", description = "Specifies the parameters for generating round trip routes.")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class RouteRequestRoundTripOptions {
public static final String PARAM_LENGTH = "length";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.heigit.ors.api.responses.matrix.MatrixResponseInfo;
import org.heigit.ors.matrix.MatrixResult;

@Schema(description = "The Matrix Response contains one matrix for each specified `metrics` value.")
@Schema(name = "MatrixResponse", description = "The Matrix Response contains one matrix for each specified `metrics` value.")
public class JSONMatrixResponse extends MatrixResponse {
public JSONMatrixResponse(MatrixResult result, MatrixRequest request) {
super(result, request);
Expand Down

0 comments on commit e713c0d

Please sign in to comment.