|
1234567891011121314151617181920212223 |
- PuffPastry Backend OpenAPI and Frontend SDK Generation
-
- This backend exposes an OpenAPI 3.0 document at:
-
- GET http://localhost:7300/openapi.json
-
- You can generate a TypeScript client for your frontend using openapi-typescript-codegen:
-
- 1) Install the generator (once):
- npm install -g openapi-typescript-codegen
-
- 2) Run code generation (adjust output path to your frontend project):
- openapi --input http://localhost:7300/openapi.json --output ../frontend/src/api --client axios
-
- If you prefer, you can output a local file first:
-
- curl -s http://localhost:7300/openapi.json -o openapi.json
- openapi --input openapi.json --output ../frontend/src/api --client axios
-
- Notes
- - The current OpenAPI spec is minimal and focuses on request shapes and endpoints. It’s sufficient for client generation.
- - We can later switch to automatic spec generation with Apistos annotations without changing the endpoint path.
- - If you add new endpoints, update the spec in src/routes/openapi.rs accordingly, or let’s enhance it with Apistos once we decide on the annotation strategy.
|