Describe the bug
A missing realm is an appropriate call to the API, it will retrieve all realms. The serialization of that fails due to the type expecting a non-empty string, and the API should only return one value.
To Reproduce
Steps to reproduce the behavior:
Create a bootstrap function that creates a default realm using environment variables.
Do not populate the environment variable for realm.
Before creating the default realm, check if the default realm exists.
See response serialization error: could not get realm: json: cannot unmarshal array into Go value of type gocloak.RealmRepresentation
Expected behavior
Malformed request error.
Additional context
I have a bunch of environment variables and missed the guard for realm, burned a lot of time trying to figure out why the serialization wasn't working, until I saw that the call for GetRealms was the same but realm was an empty string.
Describe the bug A missing realm is an appropriate call to the API, it will retrieve all realms. The serialization of that fails due to the type expecting a non-empty string, and the API should only return one value.
To Reproduce Steps to reproduce the behavior:
could not get realm: json: cannot unmarshal array into Go value of type gocloak.RealmRepresentation
Expected behavior Malformed request error.
Additional context I have a bunch of environment variables and missed the guard for realm, burned a lot of time trying to figure out why the serialization wasn't working, until I saw that the call for GetRealms was the same but realm was an empty string.