您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1 个月前
1234567891011121314151617181920212223
  1. PuffPastry Backend OpenAPI and Frontend SDK Generation
  2. This backend exposes an OpenAPI 3.0 document at:
  3. GET http://localhost:7300/openapi.json
  4. You can generate a TypeScript client for your frontend using openapi-typescript-codegen:
  5. 1) Install the generator (once):
  6. npm install -g openapi-typescript-codegen
  7. 2) Run code generation (adjust output path to your frontend project):
  8. openapi --input http://localhost:7300/openapi.json --output ../frontend/src/api --client axios
  9. If you prefer, you can output a local file first:
  10. curl -s http://localhost:7300/openapi.json -o openapi.json
  11. openapi --input openapi.json --output ../frontend/src/api --client axios
  12. Notes
  13. - The current OpenAPI spec is minimal and focuses on request shapes and endpoints. It’s sufficient for client generation.
  14. - We can later switch to automatic spec generation with Apistos annotations without changing the endpoint path.
  15. - 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.