* Bash: Update samples I'm about to make a fix to the bash generator. I'm regenerating the samples in this commit so that the change I make isn't lost amongst the noise. https://github.com/OpenAPITools/openapi-generator/pull/3290 * Bash client: Fix query params seperation Fix bug where empty query parameters weren't separated by ampersands. For example, this ```bash bash bash_keycloak/client.sh -v --oauth2-bearer "$access_token" --host "$api_host" realmUsersGet realm=demo_realm2 email=foo+bar@baz.com ``` would generate the path `/auth/admin/realms/demo_realm2/users?briefRepresentation=email=foo+bar@baz.comfirst=firstName=lastName=max=search=username=`. It now puts ampersands around them to make `/auth/admin/realms/demo_realm2/users?briefRepresentation=&email=foo+bar@baz.com&first=&firstName=&lastName=&max=&search=&username=` Instead of predicting if there is going to be a `parameter_value` ahead of time, we now put in the ampersand if there is a `parameter_value` and existing `query_request_part`. https://github.com/OpenAPITools/openapi-generator/pull/3290 * Bash: Skip query parameters with empty value I have a route with many optional query parameters. I observed that when they weren't specified, they were still included in the routes, but without a value. Running: ```bash bash bash_keycloak/client.sh -v --header "Authorization: Bearer $access_token" --host "$api_host" --dry-run realmUsersGet realm=demo_realm2 email=foo+bar@baz.com username=foo ``` Would produce the route: `http://localhost:8080/auth/admin/realms/demo_realm2/users?briefRepresentation=&email=foo+bar@baz.com&first=&firstName=&lastName=&max=search=&username=foo` After this change it produces the route: ``http://localhost:8080/auth/admin/realms/demo_realm2/users?email=foo+bar@baz.com&username=foo --- I discussed with @wing328 in the pull request about if empty values (eg `username=` should produce an empty query parameter, or if the query parameter should be removed. We decided it should remove the query parameter. https://github.com/OpenAPITools/openapi-generator/pull/3290 ---- The OpenAPI definition I was using: Using: https://github.com/ccouzens/keycloak-openapi/blob/master/keycloak/6.0.json In particular: ```json "/{realm}/users": { "get": { "summary": "Get users Returns a list of users, filtered according to query parameters", "parameters": [ { "in": "query", "name": "briefRepresentation", "schema": { "type": "boolean" }, "style": "form" }, { "in": "query", "name": "email", "schema": { "type": "string" }, "style": "form" }, { "in": "query", "name": "first", "schema": { "type": "integer", "format": "int32" }, "style": "form" }, { "in": "query", "name": "firstName", "schema": { "type": "string" }, "style": "form" }, { "in": "query", "name": "lastName", "schema": { "type": "string" }, "style": "form" }, { "in": "query", "name": "max", "description": "Maximum results size (defaults to 100)", "schema": { "type": "integer", "format": "int32" }, "style": "form" }, { "in": "query", "name": "search", "description": "A String contained in username, first or last name, or email", "schema": { "type": "string" }, "style": "form" }, { "in": "query", "name": "username", "schema": { "type": "string" }, "style": "form" } ], ```
6.3 KiB
UserApi
All URIs are relative to /v2
Method | HTTP request | Description |
---|---|---|
createUser | POST /user | Create user |
createUsersWithArrayInput | POST /user/createWithArray | Creates list of users with given input array |
createUsersWithListInput | POST /user/createWithList | Creates list of users with given input array |
deleteUser | DELETE /user/{username} | Delete user |
getUserByName | GET /user/{username} | Get user by user name |
loginUser | GET /user/login | Logs user into the system |
logoutUser | GET /user/logout | Logs out current logged in user session |
updateUser | PUT /user/{username} | Updated user |
createUser
Create user
This can only be done by the logged in user.
Example
petstore-cli createUser
Parameters
Name | Type | Description | Notes |
---|---|---|---|
body | User | Created user object |
Return type
(empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not Applicable
- Accept: Not Applicable
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createUsersWithArrayInput
Creates list of users with given input array
Example
petstore-cli createUsersWithArrayInput
Parameters
Name | Type | Description | Notes |
---|---|---|---|
body | array[User] | List of user object |
Return type
(empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not Applicable
- Accept: Not Applicable
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createUsersWithListInput
Creates list of users with given input array
Example
petstore-cli createUsersWithListInput
Parameters
Name | Type | Description | Notes |
---|---|---|---|
body | array[User] | List of user object |
Return type
(empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not Applicable
- Accept: Not Applicable
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteUser
Delete user
This can only be done by the logged in user.
Example
petstore-cli deleteUser username=value
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | string | The name that needs to be deleted | [default to null] |
Return type
(empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not Applicable
- Accept: Not Applicable
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getUserByName
Get user by user name
Example
petstore-cli getUserByName username=value
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | string | The name that needs to be fetched. Use user1 for testing. | [default to null] |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not Applicable
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
loginUser
Logs user into the system
Example
petstore-cli loginUser username=value password=value
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | string | The user name for login | [default to null] |
password | string | The password for login in clear text | [default to null] |
Return type
string
Authorization
No authorization required
HTTP request headers
- Content-Type: Not Applicable
- Accept: application/xml, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
logoutUser
Logs out current logged in user session
Example
petstore-cli logoutUser
Parameters
This endpoint does not need any parameter.
Return type
(empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not Applicable
- Accept: Not Applicable
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateUser
Updated user
This can only be done by the logged in user.
Example
petstore-cli updateUser username=value
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | string | name that need to be deleted | [default to null] |
body | User | Updated user object |
Return type
(empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not Applicable
- Accept: Not Applicable
[Back to top] [Back to API list] [Back to Model list] [Back to README]