This repository was archived by the owner on Jan 21, 2026. It is now read-only.
Initial implementation of the connect command, with tests - #179
Merged
Conversation
… to make it reusable by the other commands that need part of it (list, help, all the http commands, etc).
jodavis
approved these changes
Aug 22, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a second attempt at addressing #148 and cleaning up some of the syntax and auto-detection issues.
This PR creates a new command:
The argument
rootAddressand the two options--baseand--swaggerare all optional, but at least one must be specified.Some examples of how you would use this:
This would let the tool try to figure everything out based on a root address. It would attempt to (initially) use the root address as the base address, and then try to find the swagger address based on the root address. It would set the base address to an address specified in the swagger definition if one was present.
This is almost the same as example 1, except that the explicit base address will not be overridden by an address in the swagger definition
This would skip auto-detection of the swagger address since one is explicitly specified. If no base address was present in the swagger definition, the user could be left in a state where they don't have a base address.
This variant explicitly sets the base address, so it won't be overridden by the swagger definition (handy if there are multiple addresses in the swagger definition). It also shows that you can use relative urls for the
--baseoption.This variant explicitly sets the swagger address since it is not in a well-known location. It also shows that you can use relative urls for the
--swaggeroption.This final variant allows you to explicitly set both the base and the swagger addresses, which can be necessary if there is no obvious tie between them or if your swagger address was not in a well-known location and you wanted to pick a base address other than the first one present in the swagger definition.
I'll have further commits that remove theset swaggercommand and clean up theset basecommand, but wanted to get this out as soon as possible.set swaggerhas been removed andset basehas had the autodetection taken out. The former involved a little more refactoring than I realized since it was used by other commands.