Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Allow full paths in REST requests #301

Merged
merged 1 commit into from
Feb 14, 2022
Merged

Conversation

paulomarg
Copy link
Contributor

@paulomarg paulomarg commented Feb 11, 2022

WHY are these changes introduced?

Currently, we can't handle requests like access scopes (/admin/oauth/access_scopes.json) or token access (/admin/api_permissions/current.json), because these resources use custom paths instead of the default /admin/api/{version}/....

This means we can't easily reach those endpoints unless the code uses the base HTTP client that the REST one is built upon, which makes things unnecessarily complicated.

WHAT is this pull request doing?

This PR solves that problem by allowing REST calls in the Admin API client to be made using a full path. Therefore, requests like

const client = new RestClient(domain, 'token');
const response = await client.get({path: '/admin/some-path.json'});

work just like any regular request would.

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added a changelog entry, prefixed by the type of change noted above
  • I have added/updated tests for this change
  • I have documented new APIs/updated the documentation for modified APIs (for public APIs)

@paulomarg paulomarg requested a review from a team as a code owner February 11, 2022 15:02
@paulomarg paulomarg force-pushed the paulo/allow_full_rest_paths branch from d95245f to 5bb7011 Compare February 11, 2022 15:02
@paulomarg paulomarg force-pushed the paulo/allow_full_rest_paths branch from 5bb7011 to 7d9f561 Compare February 11, 2022 16:00
@paulomarg paulomarg merged commit 1f41c4c into main Feb 14, 2022
@paulomarg paulomarg deleted the paulo/allow_full_rest_paths branch February 14, 2022 18:06
@shopify-shipit shopify-shipit bot temporarily deployed to next March 8, 2022 22:13 Inactive
@shopify-shipit shopify-shipit bot temporarily deployed to production April 4, 2022 13:57 Inactive
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants