sdk icon indicating copy to clipboard operation
sdk copied to clipboard

[Feature]: Check `RESTStream.url_base` for trailing slashes

Open edgarrmondragon opened this issue 3 years ago • 5 comments

Feature scope

Taps (catalog, state, stream maps, etc.)

Description

Trailing slashes in RESTStream.url_base (or leading slashes in RESTStream.path, which is an undocumented attribute) cause URLs to have a double slash //. This is handled by requests by stripping the path and redirecting to the base URL, which is not what developers want in most situations.

Other documentation changes that would be good to ship with this feature:

  • Example RESTStream.url_base should not have a trailing slash
  • RESTStream.path should be documented in https://sdk.meltano.com/en/latest/classes/singer_sdk.RESTStream.html

Related:

  • #883

edgarrmondragon avatar Aug 03 '22 19:08 edgarrmondragon

@edgarrmondragon - I think the naive expectation we set was that they would be concatenated together and that the slash could exist on one but not both of url_base and path.

Is the proposal that we'd automatically strip a trailing slash on url_base or that we would fail tests with an error, or something else?

aaronsteers avatar Aug 03 '22 20:08 aaronsteers

@aaronsteers

Is the proposal that we'd automatically strip a trailing slash on url_base or that we would fail tests with an error, or something else?

I prefer the first option. It would mean we also have to ensure there's a leading slash in .path. It's probably better to attempt conforming the URL and path under the hood, rather than failing.

edgarrmondragon avatar Aug 03 '22 22:08 edgarrmondragon

This has been marked as stale because it is unassigned, and has not had recent activity. It will be closed after 21 days if no further activity occurs. If this should never go stale, please add the evergreen label, or request that it be added.

stale[bot] avatar Jul 18 '23 06:07 stale[bot]

Still relevant

edgarrmondragon avatar Jul 18 '23 20:07 edgarrmondragon

This has been marked as stale because it is unassigned, and has not had recent activity. It will be closed after 21 days if no further activity occurs. If this should never go stale, please add the evergreen label, or request that it be added.

stale[bot] avatar Jul 18 '24 03:07 stale[bot]