Frequently Asked Questions
Common questions and answers about swagger-to-tanstack.
How do I preserve custom code during regeneration?
Use the // @custom comment marker above any code you want to preserve. The generator will skip these sections during updates.
Can I use multiple Swagger files?
Yes! Run the generate command multiple times with different input files and output directories, or use the configuration file to define multiple generation targets.
What Node.js version is required?
Node.js 16 or higher is required. We recommend using the latest LTS version for best performance and compatibility.
How do I handle authentication?
Configure authentication headers in your configuration file or modify the generated client file:
Can I customize the generated code style?
The generated code follows common TypeScript conventions. You can run ESLint and Prettier on the output directory to match your project's code style.
Does it support OpenAPI 3.1?
Yes! swagger-to-tanstack supports both OpenAPI 2.0 (Swagger) and OpenAPI 3.0/3.1 specifications.
How do I handle file uploads?
File uploads are automatically detected from the Swagger spec. Enable multipart/form-data handling in your configuration:
Can I generate code for specific endpoints only?
Yes! Use the --tags option to include only specific endpoints:
Is TypeScript required?
While the generated code is TypeScript, you can use it in JavaScript projects. However, you'll miss out on the type safety benefits.
How do I report bugs or request features?
Open an issue on our GitHub repository. We welcome contributions and feedback!