Skip to content

Commit

Permalink
[Azure Maps] Route: Swagger improvement for SDK generation [Hub Gener…
Browse files Browse the repository at this point in the history
…ated] (Azure#16193)

* Route: Rename parameter/client names

* Route: Rename request body names

* Route: Model a few objects as enum

* Route: rename magnitudeOfDelay

* Route: update startPointIndex/endPointIndex docstrings

* Route: departureTime/arrivalTime to date-time

* Route: Fix name in typescript.md

* Route: modify docstrings for firstInstructionIndex/lastInstructionIndex

* Route: rename turnAngleInDecimalDegrees

* Route: Add docstrings for RouteSection/RouteLeg

* Route: rename report object

* Route: add friendly x-ms-examples key name

* Route: rearrange definitions for better review

* Route: remove language reference in hyperlink

* Route: Remove repeated descriptions of batch API

* Changed model name RouteDirectionsSummary to RouteSummary

* Rename to RouteRangeResponse

* Add max/min values for efficiency

* Name changing with x-ms-client-name

* Minor update

* Route: naming fix

* renamed all kWh to KwH

* Route: add default values

* Route: Fix wrong name

* Route: Change response type name

* Updated name and descriptions for route attributes

* Remote language in URL

* Route: definition name changed for type name

* Route: keep the operations for maintaining SDK consistencies

* Route: Change response object names

* Route: Fix parameter type

* Common: Add more definitions for better client type name

* Common: Add description for query parameter

* Route: Just rename RouteSummary Definition

* Common: Redo the naming for batchItems

* Route: add names for x-ms-enum

* Route: change all floats to doubles (verified in backend)

* Route: use collectionFormat for route range api

* Route: rename operationIds to remove Post wording

* Modified two method names

* Route: update vehicleCommericial's client name

* Route: update description/client name for carTrain

Co-authored-by: Alex Tsao <[email protected]>
Co-authored-by: Daniel Rocha <[email protected]>
  • Loading branch information
3 people authored and frank-pang-msft committed Oct 25, 2021
1 parent 52651f2 commit f01e3d0
Show file tree
Hide file tree
Showing 8 changed files with 524 additions and 209 deletions.
33 changes: 20 additions & 13 deletions specification/maps/data-plane/Common/preview/1.0/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,29 @@
},
"BatchRequestBody": {
"description": "This type represents the request body for the Batch service.",
"x-ms-client-name": "BatchRequest",
"type": "object",
"properties": {
"batchItems": {
"description": "The list of queries to process.",
"type": "array",
"items": {
"description": "Batch Query object",
"type": "object",
"properties": {
"query": {
"description": "Partial query string.",
"type": "string",
"example": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"
}
}
}
"$ref": "#/definitions/BatchQueries"
}
}
},
"BatchQueries": {
"description": "The list of queries to process.",
"type": "array",
"items": {
"$ref": "#/definitions/BatchQuery"
}
},
"BatchQuery": {
"description": "Batch Query object",
"type": "object",
"properties": {
"query": {
"description": "A query string for the corresponding batch API endpoint. It is the exact query string you would use for a single (non-batch) API request.",
"type": "string",
"example": "?query=One, Microsoft Way, Redmond, WA 98052&limit=3"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"format": "json",
"api-version": "1.0",
"query": "52.50931,13.42936:52.50274,13.43872",
"postRouteDirectionsRequestBody": {
"routeDirectionParameters": {
"supportingPoints": {
"type": "GeometryCollection",
"geometries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parameters": {
"format": "json",
"api-version": "1.0",
"postRouteDirectionsBatchRequestBody": {
"routeDirectionsBatchQueries": {
"batchItems": [
{
"query": "?query=47.639987,-122.128384:47.621252,-122.184408:47.596437,-122.332000&routeType=fastest&travelMode=car&maxAlternatives=99"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parameters": {
"format": "json",
"api-version": "1.0",
"postRouteDirectionsBatchRequestBody": {
"routeDirectionsBatchQueries": {
"batchItems": [
{
"query": "?query=47.639987,-122.128384:47.621252,-122.184408:47.596437,-122.332000&routeType=fastest&travelMode=car&maxAlternatives=99"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"format": "json",
"api-version": "1.0",
"routeType": "shortest",
"postRouteMatrixRequestBody": {
"routeMatrixQuery": {
"origins": {
"type": "MultiPoint",
"coordinates": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"format": "json",
"api-version": "1.0",
"routeType": "shortest",
"postRouteMatrixRequestBody": {
"routeMatrixQuery": {
"origins": {
"type": "MultiPoint",
"coordinates": [
Expand Down
684 changes: 498 additions & 186 deletions specification/maps/data-plane/Route/preview/1.0/route.json

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions specification/maps/data-plane/Route/readme.typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@ clear-output-folder: false
generate-metadata: false
directive:
- from: route.json
where: $.definitions.PostRouteDirectionsRequestBody.properties.supportingPoints
where: $.definitions.RouteDirectionParameters.properties.supportingPoints
transform: >
$ = {
"description": "A GeoJSON Geometry collection representing sequence of coordinates used as input for route reconstruction and for calculating zero or more alternative routes to this reference route.\n - The provided sequence of supporting points is used as input for route reconstruction.\n - The alternative routes are calculated between the origin and destination points specified in the base path parameter locations.\n - If both _minDeviationDistance_ and _minDeviationTime_ are set to zero, then these origin and destination points are\n expected to be at (or very near) the beginning and end of the reference route, respectively.\n - Intermediate locations (_waypoints_) are not supported when using <_supportingPoints_>.\n - The reference route may contain traffic incidents of type _ROAD_CLOSURE_, which are\n ignored for the calculation of the reference route's travel time and traffic delay.",
"type": "object"
};
reason: Autorest TS codegen does not deserialize array of base class objects as an operation parameter properly -> https://github.com/Azure/autorest.typescript/issues/1040
- remove-operation: Route_GetRouteMatrix
reason: This operation is created for Java SDK that has no LRO poller implementation
- remove-operation: Route_GetRouteDirectionsBatch
reason: This operation is created for Java SDK that has no LRO poller implementation
```

0 comments on commit f01e3d0

Please sign in to comment.