class ClientCreate extends ClientUpdate {
String type;
// properties manadatory for creation
}
class ClientUpdate{
String name;
String description;
// updatable properties
}
@Path("/clients")
@POST
Response create(ClientCreate client) {
...
}
@Path("/clients/{clientUuid}")
@PUT
Response update(@PathParam("clientUuid") String clientUuid, ClientUpdate client) {
...
}
Last active
March 24, 2025 13:05
-
-
Save thomasdarimont/06906788dc721ae84ddcab1f420eb877 to your computer and use it in GitHub Desktop.
API Sketch - Using different types to restrict available fields
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment