Skip to content

Commit

Permalink
fixed minimal example
Browse files Browse the repository at this point in the history
  • Loading branch information
kilork committed Mar 25, 2024
1 parent 9f9cfb6 commit e7ec245
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
10 changes: 9 additions & 1 deletion examples/openapi.patch.toml
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# [path.""]
[path."/admin/realms:post:body"]
from_type = "String"
rust_type = "RealmRepresentation"
[path."/admin/realms:get:"]
from_type = "Value"
rust_type = "RealmRepresentation"
[path."/admin/realms/{realm}/users:get:"]
from_type = "Value"
rust_type = "TypeVec<UserRepresentation>"
9 changes: 6 additions & 3 deletions src/rest/generated_rest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4942,7 +4942,10 @@ impl<TS: KeycloakTokenSupplier> KeycloakAdmin<TS> {
///
/// Documentation: <https://www.keycloak.org/docs-api/22.0.3/rest-api/index.html#_get_adminrealms>
#[cfg(feature = "tag-realms-admin")]
pub async fn get(&self, brief_representation: Option<bool>) -> Result<Value, KeycloakError> {
pub async fn get(
&self,
brief_representation: Option<bool>,
) -> Result<RealmRepresentation, KeycloakError> {
let mut builder = self
.client
.get(&format!("{}/admin/realms", self.url))
Expand All @@ -4966,7 +4969,7 @@ impl<TS: KeycloakTokenSupplier> KeycloakAdmin<TS> {
///
/// Documentation: <https://www.keycloak.org/docs-api/22.0.3/rest-api/index.html#_post_adminrealms>
#[cfg(feature = "tag-realms-admin")]
pub async fn post(&self, body: String) -> Result<(), KeycloakError> {
pub async fn post(&self, body: RealmRepresentation) -> Result<(), KeycloakError> {
let builder = self
.client
.post(&format!("{}/admin/realms", self.url))
Expand Down Expand Up @@ -9047,7 +9050,7 @@ impl<TS: KeycloakTokenSupplier> KeycloakAdmin<TS> {
q: Option<String>,
search: Option<String>,
username: Option<String>,
) -> Result<Value, KeycloakError> {
) -> Result<TypeVec<UserRepresentation>, KeycloakError> {
let mut builder = self
.client
.get(&format!("{}/admin/realms/{realm}/users", self.url))
Expand Down

0 comments on commit e7ec245

Please sign in to comment.