Created
April 13, 2023 18:50
-
-
Save bgoetzmann/4ac447731f07a0e02f7505c1847aee40 to your computer and use it in GitHub Desktop.
Interface to call SWAPI in restclient application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package odelia.restclient; | |
import javax.json.JsonObject; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; | |
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.PathParam; | |
@RegisterRestClient | |
@Produces(MediaType.APPLICATION_JSON) | |
public interface SwapiService { | |
@GET | |
@Path("/people/{id}") | |
JsonObject getCharacter(@PathParam("id") String id); | |
@GET | |
@Path("/people") | |
JsonObject getPeople(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment