[FEATURE] Inserted a way to automatically obtain rest API url endpoint with swagger #3762
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.
here I inserted a new "server" field in the openAPI root specification that allows to automatically populating the URL that will be used in subsequent rest API calls by swagger. This is based by the fact that swagger defaults to the url used to host the definition file, so if this is the case, upon opening swagger automatically the selected "server" field will be the one I inserted which references to the same host where the file is placed.
[possible side effects]
it should be noted that I had to hardcode in the definition of this field only the version (/v1) so if in the future we will have a new one this field will need to be changed. I did not find a way to let Swagger populate all the url EXCEPT FOR the version, customizable with a field.