-
Notifications
You must be signed in to change notification settings - Fork 507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to change output filename #360
Comments
There really isn't a reason. Feel free to PR to make it configurable. |
@HoldYourWaffle what is the value in having the file name be different? I believe there is a larger value in that if you’re a developer who is familiar with tsoa then you know that there will be a routes.ts file in the project. This provides consistency so that developers familiar with tsoa can move from project to project. That’s why I’m wondering what the value is for changing the file name. It would have to be higher value than the benefit of consistency. |
The reason why I want to change filenames is because I use custom templates to generate both the server routes and the client SDK using TSOA. Having I do this because I want more control over generated code. Because both sides are in Typescript for me, Swagger/OpenAPI is an unnecessary middleman (and just generally very unhelpful). This also allows me to easily share things like type definitions across sides which is always very helpful. |
This feature is also very important for the swagger.json file. As of version 3 of the spec, it is no longer called Swagger. It is OpenAPI. It is wrong and misleading to call the output swagger.json. It's more than just aesthetic though: Visual Studio Code with the openapi-lint extension automatically picks up *swagger.json files as OAS2, and therefore the linting and intellisense is broken until the file is renamed to openapi.json, which it will treat as OAS3. Just as a final point, in my 20+ years as a developer, I have never come across a command line tool that doesn't let you (either via command line flags, or config files) override the output filename. |
I completely forgot that there's another filename that generates when creating the PR, we should definitely fix that. @dgreene1 Should we create a new issue of this or reopen this one? |
Sure I'll reopen this issue so you can add that @HoldYourWaffle. And@pdeak we'll get working on that for you. :) |
@dgreene1 Can you please assign me to this issue so I don't forget? |
Thanks guys |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
I'd like to take a stab at renaming swagger.json/yaml. Naming things is hard; any thoughts on what you'd want the setting to be called? I see Maybe |
I like |
@edbrannin @WoH Are there any plans to complete PR #589? I'd also love the ability to rename the swagger.json file |
The
routes.ts
output filename is currently hard coded:tsoa/src/routeGeneration/routeGenerator.ts
Line 26 in 7c9dbd0
I'd love to have an option to change this filename. I was going to make a PR for this, but the fact that such a trivial thing hasn't been implemented yet makes me wonder if there's an actual reason for it.
The text was updated successfully, but these errors were encountered: