An open API service indexing awesome lists of open source software.

https://github.com/ifsantana/rest-api-custom-methods

A sample project about how to use custom methods - [Google AIP-136](https://google.aip.dev/136)
https://github.com/ifsantana/rest-api-custom-methods

custom-methods http-requests kotlin rest-api restful-api spring-boot

Last synced: about 2 months ago
JSON representation

A sample project about how to use custom methods - [Google AIP-136](https://google.aip.dev/136)

Awesome Lists containing this project

README

          

# Rest Api Custom Methods Sample

Custom methods

Resource-oriented design ([AIP-121](https://google.aip.dev/121)) uses custom methods to provide a means to express arbitrary actions that are difficult to model using only the standard methods.
Custom methods are important because they provide a means for an API's vocabulary to adhere to user intent.

Guidance

Custom methods should only be used for functionality that can not be easily expressed via standard methods; prefer standard methods if possible, due to their consistent semantics. (Of course, this only applies if the functionality in question actually conforms to the normal semantics; it is not a good idea to contort things to endeavor to make the standard methods "sort of work".)

Resource-based custom methods

Custom methods must operate on a resource if the API can be modeled as such the examples below:

## Endpoitns List

### Enable Users

```http://localhost:8080/v1/users/1:enable```

### Disable Users

```http://localhost:8080/v1/users/1:disable```