You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: functions-python/operations_api/README.md
+64-2Lines changed: 64 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
# Operations API
2
-
The Operations API is a function that exposes the operations API.
3
-
The operations API schema is located at ../../docs/OperationsAPI.yml.
2
+
The Operations API is a Google Cloud Function exposing internal operations endpoints for the Mobility Database.
3
+
The Operations API OpenAPI schema lives at `../../docs/OperationsAPI.yaml`.
4
+
5
+
> Note: generated server stubs are created from the schema. Do not edit generated code under `src/feeds_gen/`; put implementation under `src/feeds_operations/impl/`.
4
6
5
7
# Function configuration
6
8
The function is configured using the following environment variables:
@@ -18,7 +20,67 @@ The function is configured using the following environment variables:
18
20
```
19
21
- Start local and test database
20
22
```
23
+
# from the repository root
21
24
docker compose --env-file ./config/.env.local up -d liquibase-test
25
+
```
26
+
- Update OperationsAPI OpenAPI components with Mobility Database Catalog API components
27
+
```
28
+
./scripts/api-operations-update-schema.sh
29
+
```
30
+
31
+
32
+
## Development process
33
+
34
+
Follow these steps when working on the Operations API:
35
+
36
+
1) Prerequisites
37
+
- Install OpenAPI Generator (one-time):
38
+
```
39
+
./scripts/setup-openapi-generator.sh
40
+
```
41
+
- Ensure yq v4+ is available (required by the schema sync script). On macOS:
42
+
```
43
+
brew install yq
44
+
```
45
+
46
+
2) Start databases locally (from repo root)
47
+
```
48
+
docker compose --env-file ./config/.env.local up -d liquibase-test
49
+
```
50
+
51
+
3) Sync Operations schema components from the Catalog API
52
+
- When the Catalog API schemas (`docs/DatabaseCatalogAPI.yaml`) change, update Operations to keep shared data models in sync while preserving operation-only ones:
53
+
```
54
+
./scripts/api-operations-update-schema.sh
55
+
```
56
+
This replaces `components.schemas` in `docs/OperationsAPI.yaml` with those from the Catalog, but preserves only schemas marked `x-operation: true` in Operations (non-operation dest-only schemas are removed).
57
+
58
+
4) Regenerate Operations API server stubs
59
+
```
60
+
./scripts/api-operations-gen.sh
61
+
```
62
+
Generated code goes to `functions-python/operations_api/src/feeds_gen/`.
63
+
64
+
5) Implement or update handlers
65
+
- Extend the generated base classes under `src/feeds_gen/` in your implementation files under:
0 commit comments