This repository was archived by the owner on Apr 2, 2025. It is now read-only.
Commit df6d1f0
ProductRouter split from RootRouter (nee StapiRouter) (#80)
This changeset includes a number of fixes to better align behavior with the spec and fix bugs, and a whole bunch of clean up. The main feature is moving the `GET /opportunities` and `POST /orders` endpoints under the product path, such as `/products/{product_id}/opportunities`, as the spec has determined that opportunities and placing an order are product-specific (see stapi-spec/stapi-spec#198 and stapi-spec/stapi-spec#200). This changeset also adds the missing `/products/{product_id}/constraints` endpoint (formerly parameters).
Another key feature is the introduction of the `bin/server.py` script that can be used with uvicorn to run a minimal implementation for local browsing. See the README for instructions.
* initial implementation of router composition for products
* make OpportunityProperties and Opportunity models generics
* overhaul the main router as APIRouter, product router not a factory, add product router classmethod to main router
* resolve merge conflicts
* sort out the conftest a bit more
* the /products/{product_id}/opportunities endpoint is accessible
* adds product router and backend
* wip: splits backend and router for root and product.
Co-authored-by: Jarrett Keifer <[email protected]>
* adds test for get_constraints
* remove unused modules
* various cleanup and refinements
* no longer a problem with the root router / route
* rename tests/backend{,s}.py
* get tests passing
* more cleanup
* fixes StapiExceptions
Co-authored-by: Tyler <[email protected]>
Co-authored-by: Jarrett Keifer <[email protected]>
* removes dupe HTTPException in models
* passes product router instead of product to backend
Co-authored-by: Tyler <[email protected]>
Co-authored-by: Jarrett Keifer <[email protected]>
* Adds OrderCollection type and returns for get_orders
Co-authored-by: Tyler <[email protected]>
Co-authored-by: Jarrett Keifer <[email protected]>
* type the opporunities to the product constraints model
* upgrade fastapi
* fix GeoJSONResponse model bug per openapi docs
* minimal test server to allow accessing openapi docs
* remove nulls from serialized links
* tests should fail not warn on spec incompatibility
* add nocover to protocol implementations
* standardize links on models
---------
Co-authored-by: Mike Parks <[email protected]>
Co-authored-by: Jarrett Keifer <[email protected]>
Co-authored-by: Tyler <[email protected]>1 parent f59e634 commit df6d1f0
File tree
29 files changed
+855
-498
lines changed- bin
- src/stapi_fastapi
- backends
- models
- routers
- types
- tests
- backend
29 files changed
+855
-498
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
| 55 | + | |
49 | 56 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments