-
Notifications
You must be signed in to change notification settings - Fork 219
Open
Description
Bug Report
Version
svix v1.76.1
Platform
Darwin 24.4.0 Darwin Kernel Version 24.4.0
Description
OpenAPI Code Generation Version Compatibility Issue: 3.0.2 vs 3.1.0 Causing SDK Generation Failures
I tried this code:
- Generate OpenAPI specification:
./server/generate-openapi.sh- Generate SDKs using the generated OpenAPI:
cp ./server/openapi.json ./codegen/lib-openapi.json
python regen_openapi.pyI expected to see this happen:
- OpenAPI specification generated successfully
- All language SDKs generated without errors
- No version compatibility issues
Instead, this happened:
First Error - Invalid Escape Sequence:
invalid escape at line 12 column 53
Error location: "pattern": "^[a-zA-Z0-9\-_.]+$" - invalid escape sequence \-
Second Error - Missing Success Responses:
After fixing the escape sequence and changing OpenAPI version from 3.0.2 to 3.1.0:
every operation must have one success response
Root Cause Analysis:
Found 3 API operations missing success response definitions:
DELETE /api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content(missing 204 response)DELETE /api/v1/app/{app_id}/msg/{msg_id}/content(missing 204 response)HEAD /api/v1/health(missing 200 response)
Technical Details:
- Code generation tools expect OpenAPI 3.1.0, but generation script outputs 3.0.2 by default
- Rust code defines operations returning
StatusCode::NO_CONTENTand(StatusCode, Json<HealthReport>), but Aide framework doesn't automatically generate corresponding OpenAPI response definitions - This causes a mismatch between what the Rust code returns and what the OpenAPI spec documents
Questions:
- Am I doing something wrong in my approach? Should I be using a different version or configuration?
- What's the correct way to handle this? Should I always use OpenAPI 3.1.0 for code generation or manually add response definitions in Rust code?
- Is there a specific workflow I should follow for generating OpenAPI specs and then generating SDKs?
Related Files:
server/generate-openapi.sh- OpenAPI generation scriptcodegen/codegen.toml- Code generation configurationserver/svix-server/src/v1/endpoints/message.rs- Message endpoint definitionsserver/svix-server/src/v1/endpoints/attempt.rs- Attempt endpoint definitionsserver/svix-server/src/v1/endpoints/health.rs- Health check endpoint definitions
Metadata
Metadata
Assignees
Labels
No labels