Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requests: declarative and unified interface #58

Merged
merged 6 commits into from
Feb 12, 2024
Merged

Conversation

ksol
Copy link
Contributor

@ksol ksol commented Feb 11, 2024

This PR changes how methods are declared in order to be as consistent as possible in the way it deals with url params, query params, payload, and so on.

As a side-effect, a declarative interface was setup in order to both make dead simple to add an endpoint, and to ensure that all methods stay consistent. See each existing endpoint in order to see the new syntax for declaring endpoints.

Implementation notes

  • paths follow the URI Template format
  • templates variables are checked in the arguments received. If some are optionnal, they need to be declared as such
  • the payload can be automatically wrapped in a root key
  • using a non-authenticated connection is more explicit than previously

The specs had to be slightly updated in order to reflect the changes in the API, but they were modified as little as possible.

@ksol ksol changed the title refactor(inspect): slightly update method Requests: declarative and unified interface Feb 11, 2024
@ksol ksol marked this pull request as ready for review February 12, 2024 09:18
Base automatically changed from refactor/responses to master February 12, 2024 09:18
Copy link
Contributor

@aurelien-reeves-scalingo aurelien-reeves-scalingo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice!

Could be a good addition to identify update path and add it in an update guide in the readme, the changelog, or a dedicated document

@ksol
Copy link
Contributor Author

ksol commented Feb 12, 2024

It's intended :)

@ksol ksol merged commit 48cb2f7 into master Feb 12, 2024
6 checks passed
@ksol ksol deleted the refactor/requests branch February 12, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants