-
Notifications
You must be signed in to change notification settings - Fork 180
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
[tsp-client] add combine-swaggers command #9017
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we support filename wildcard?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some tests for this command to make sure nobody breaks current functionality in future updates?
|
||
const documents = []; | ||
for (const file of swaggerFiles) { | ||
if (!(await doesFileExist(file))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should specify somewhere that this command only accepts the path to the swagger file and that we do not accept urls to a swagger since we do accept both in some commands.
continue; | ||
} | ||
|
||
// when b value is null and any a value exists, ignore b value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isnt this a regression if we add the value of a back into the combined swaggers?
This adds a quick and dirty
combine-swaggers
command to 'merge' multiple swagger files into a single swagger file. This is meant to make it easier to compare existing APIs split across multiple files with a TypeSpec-generated API that exists in a single file.Only top-level fields are merged at this time, and no deduplication of array values is done.