IBM / go-sdk-core

The go-sdk-core repository contains core functionality required by Go code generated by the IBM OpenAPI SDK Generator.
Apache License 2.0
30 stars 24 forks source link

fix: fixed ConstructHTTPURL to avoid '//' when path segment is empty string #31

Closed padamstx closed 4 years ago

padamstx commented 4 years ago

Fixes: https://github.ibm.com/arf/planning-sdk-squad/issues/1073

The RequestBuilder.ConstructHTTPURL function was updated so that it doesn't add a "/" to the URL string if the path segment is "". This could occur if the operation's path contains two consecutive path parameter references, as in:

"/v1/resource/{resource_type}/{resource_id}"

The VPC API definition defines a couple of paths that fit this pattern. The API handbook "disallows" this, but we should probably support it nonetheless.