v0.4.1: Code-driven OpenAPI docs via swagger-jsdoc
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Has been cancelled
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Has been cancelled
- Add swagger-jsdoc dependency for auto-generating OpenAPI spec from JSDoc - Add JSDoc @openapi annotations to all route handlers - Create scripts/generate-openapi.mjs build step - OpenAPI spec now auto-generated from code — no manual JSON editing - All 13 endpoints documented with full parameters - New demo endpoints documented, signup marked as deprecated - Updated info description: demo-first, no free tier references - Dockerfile updated to run openapi generation during build - Build script updated: npm run build generates spec before compile
This commit is contained in:
parent
53755d6093
commit
792e2d9142
12 changed files with 1931 additions and 305 deletions
63
src/openapi-extra.yaml
Normal file
63
src/openapi-extra.yaml
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
paths:
|
||||
/v1/signup/free:
|
||||
post:
|
||||
tags:
|
||||
- Account
|
||||
summary: Free signup (discontinued)
|
||||
description: |
|
||||
Free accounts have been discontinued. Use the demo endpoint for testing
|
||||
or subscribe to Pro for production use.
|
||||
deprecated: true
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
email:
|
||||
type: string
|
||||
format: email
|
||||
responses:
|
||||
'410':
|
||||
description: Free accounts discontinued
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: 'Free accounts have been discontinued.'
|
||||
demo_endpoint:
|
||||
type: string
|
||||
example: '/v1/demo/html'
|
||||
pro_url:
|
||||
type: string
|
||||
example: 'https://docfast.dev/#pricing'
|
||||
/v1/usage:
|
||||
get:
|
||||
tags:
|
||||
- System
|
||||
summary: Usage statistics (admin only)
|
||||
description: Returns usage statistics for the authenticated user. Requires admin API key.
|
||||
security:
|
||||
- BearerAuth: []
|
||||
- ApiKeyHeader: []
|
||||
responses:
|
||||
'200':
|
||||
description: Usage statistics
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: object
|
||||
properties:
|
||||
count:
|
||||
type: integer
|
||||
month:
|
||||
type: string
|
||||
'403':
|
||||
description: Admin access required
|
||||
'503':
|
||||
description: Admin access not configured
|
||||
Loading…
Add table
Add a link
Reference in a new issue