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

Various small tweaks for the REST extensions #39335

Merged
merged 3 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{#include readme-header /}
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
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;
}
}
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>)
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ metadata:
- "security"
status: "stable"
config:
- "quarkus.resteasy-client-oidc-filter."
- "quarkus.oidc-client."
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ metadata:
- "security"
status: "stable"
config:
- "quarkus.rest-client-oidc-filter."
- "quarkus.oidc-client."
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ metadata:
- "security"
status: "stable"
config:
- "quarkus.rest-client-oidc-token-propagation."
- "quarkus.oidc-token-propagation-reactive."
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ metadata:
- "security"
status: "stable"
config:
- "quarkus.resteasy-client-token-propagation."
- "quarkus.oidc-token-propagation."
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ metadata:
categories:
- "web"
codestart:
name: "rest-client"
name: "resteasy-client"
languages:
- "java"
- "kotlin"
artifact: "io.quarkus:quarkus-project-core-extension-codestarts"
config:
- "quarkus.rest-client."
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ metadata:
status: "stable"
guide: "https://quarkus.io/guides/rest-client"
codestart:
name: "rest"
kind: "core"
name: "rest-client"
languages:
- "java"
- "kotlin"
- "scala"
artifact: "io.quarkus:quarkus-project-core-extension-codestarts"
config:
- "quarkus.rest-client."
- "quarkus.rest-client-reactive."
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ metadata:
- "security"
status: "preview"
config:
- "quarkus.rest-csrf."
- "quarkus.csrf-reactive."
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ metadata:
- "scala"
artifact: "io.quarkus:quarkus-project-core-extension-codestarts"
config:
- "quarkus.rest."
- "quarkus.resteasy-reactive."
Loading