-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39335 from gsmet/rest-client-quickstart
Various small tweaks for the REST extensions
- Loading branch information
Showing
12 changed files
with
91 additions
and
4 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
.../quarkus/extension-codestarts/resteasy-client-codestart/base/README.tpl.qute.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{#include readme-header /} |
13 changes: 13 additions & 0 deletions
13
...resources/codestarts/quarkus/extension-codestarts/resteasy-client-codestart/codestart.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: resteasy-client-codestart | ||
ref: resteasy-client | ||
type: code | ||
tags: extension-codestart | ||
metadata: | ||
title: RESTEasy Client | ||
description: Invoke different services through REST with JSON | ||
related-guide-section: https://quarkus.io/guides/resteasy-client | ||
language: | ||
base: | ||
dependencies: | ||
- io.quarkus:quarkus-resteasy-client | ||
- io.quarkus:quarkus-resteasy-client-jackson |
37 changes: 37 additions & 0 deletions
37
...ion-codestarts/resteasy-client-codestart/java/src/main/java/org/acme/MyRemoteService.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.acme; | ||
|
||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.QueryParam; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
/** | ||
* To use it via injection. | ||
* | ||
* {@code | ||
* @Inject | ||
* @RestClient | ||
* MyRemoteService myRemoteService; | ||
* | ||
* public void doSomething() { | ||
* Set<MyRemoteService.Extension> restClientExtensions = myRemoteService.getExtensionsById("io.quarkus:quarkus-hibernate-validator"); | ||
* } | ||
* } | ||
*/ | ||
@RegisterRestClient(baseUri = "https://stage.code.quarkus.io/api") | ||
public interface MyRemoteService { | ||
|
||
@GET | ||
@Path("/extensions") | ||
Set<Extension> getExtensionsById(@QueryParam("id") String id); | ||
|
||
class Extension { | ||
public String id; | ||
public String name; | ||
public String shortName; | ||
public List<String> keywords; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...n-codestarts/resteasy-client-codestart/kotlin/src/main/kotlin/org/acme/MyRemoteService.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.acme | ||
|
||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient | ||
import jakarta.ws.rs.GET | ||
import jakarta.ws.rs.Path | ||
import jakarta.ws.rs.QueryParam | ||
|
||
/** | ||
* To use it via injection. | ||
* | ||
* ```kotlin | ||
* @Inject | ||
* @RestClient | ||
* lateinit var myRemoteService: MyRemoteService | ||
* | ||
* fun doSomething() { | ||
* val restClientExtensions = myRemoteService.getExtensionsById("io.quarkus:quarkus-rest-client") | ||
* } | ||
* ``` | ||
*/ | ||
@RegisterRestClient(baseUri = "https://stage.code.quarkus.io/api") | ||
interface MyRemoteService { | ||
|
||
@GET | ||
@Path("/extensions") | ||
fun getExtensionsById(@QueryParam("id") id: String): Set<Extension> | ||
|
||
data class Extension(val id: String, val name: String, val shortName: String, val keywords: List<String>) | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,5 @@ metadata: | |
- "security" | ||
status: "stable" | ||
config: | ||
- "quarkus.rest-client-oidc-filter." | ||
- "quarkus.oidc-client." |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ metadata: | |
- "security" | ||
status: "preview" | ||
config: | ||
- "quarkus.rest-csrf." | ||
- "quarkus.csrf-reactive." |
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