Skip to content

Commit e0d0574

Browse files
committed
feat: route subresource of store
1 parent bf324b3 commit e0d0574

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

model/main.smithy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use com.shopping.inandout.route#Route
1616
use com.shopping.inandout.stand#Stand
1717

1818
@mixin
19-
@restJson1
2019
service InAndOut {
2120
version: "0.0.1"
2221
errors: [

model/route/route-apis.smithy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use com.shopping.inandout.util#UUID
1111
@documentation("Travelling salesman problem and solution creation/retrieval")
1212
resource Route {
1313
identifiers: {
14+
storeId: UID
1415
routeId: UUID
1516
}
1617
properties: {
17-
storeId: UID
1818
standIdList: IDList
1919
solutionList: SolutionList
2020
}
@@ -23,7 +23,7 @@ resource Route {
2323
delete: DeleteRoute
2424
}
2525

26-
@http(method: "POST", uri: "/api/routes")
26+
@http(method: "POST", uri: "/api/stores/{storeId}/routes")
2727
operation CreateRoute {
2828
input: CreateRouteInput
2929
output: RouteSummary
@@ -33,7 +33,7 @@ operation CreateRoute {
3333
}
3434

3535
@readonly
36-
@http(method: "GET", uri: "/api/routes/{routeId}")
36+
@http(method: "GET", uri: "/api/stores/{storeId}/routes/{routeId}")
3737
operation GetRoute {
3838
input: GetRouteInput
3939
output: RouteSummary
@@ -43,7 +43,7 @@ operation GetRoute {
4343
}
4444

4545
@idempotent
46-
@http(method: "DELETE", uri: "/api/routes/{routeId}")
46+
@http(method: "DELETE", uri: "/api/stores/{storeId}/routes/{routeId}")
4747
operation DeleteRoute {
4848
input: DeleteRouteInput
4949
output: RouteSummary

model/route/route-io.smithy

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,28 @@ use com.shopping.inandout.util#UUID
88

99
structure CreateRouteInput {
1010
@required
11+
@httpLabel
1112
storeId: UID
1213

1314
@required
1415
standIdList: IDList
1516
}
1617

1718
structure GetRouteInput {
19+
@required
20+
@httpLabel
21+
storeId: UID
22+
1823
@required
1924
@httpLabel
2025
routeId: UUID
2126
}
2227

2328
structure DeleteRouteInput {
29+
@required
30+
@httpLabel
31+
storeId: UID
32+
2433
@required
2534
@httpLabel
2635
routeId: UUID

model/route/route-types.smithy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ list SolutionList {
4646

4747
structure RouteSummary {
4848
@required
49-
routeId: UUID
49+
storeId: UID
5050

5151
@required
52-
storeId: UID
52+
routeId: UUID
5353

5454
@required
5555
@documentation("The initial input")

0 commit comments

Comments
 (0)