openapi-typescript
openapi-typescript copied to clipboard
Copy the API version to output file
Description
I want to know which version of the API was used as the source for the generated TypeScript. The API that I am working with requires that the API version be sent in each request.
Proposal
Include enough of the API General Info to indicate the API version in the output file:
export type info = {
version: '1.0.0';
}
I can then surface a compilation error if I happen to be mistaken about which version of the API was used as the source of the output file:
const version: info['version'] = '1.0.0';
Checklist
- [X] I’m willing to open a PR for this.
Works for me! No harm in adding this. Would love a PR
Be sure to base off the 6.x
branch so it can be added to the stable v, then we’ll just port it to 7.x
. Since this is a backwards-compatible addition, no reason not to ship it in stable now.
This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.