Closed allonzy closed 4 days ago
The API definition originates from https://github.com/googleapis/google-api-dotnet-client/blob/main/DiscoveryJson/admin.directory_v1.json
It looks like the properties in question are being generated from Discovery doc properties with a type of "any" - which really does just mean "any object" effectively. We could have potentially chosen to use JObject
instead of object
- but changing that now would be a breaking change, and wouldn't stop anyone from having to interact with Json.NET, it would just make it slightly clearly that they did have to do that.
Maybe this json should be updated, because: The types exists in the sdk (userGender for instance) the type for addresses is correctly bind and in the REST api reference of all those field are well documented.
The JSON is effectively derived straight from the service itself - see https://admin.googleapis.com/$discovery/rest?version=directory_v1 where you'll see that gender
has a type of any
. (And yes, it describes the UserGender
type, but doesn't use it anywhere.)
I'm afraid there's nothing that the maintainers of this repository (just one of the consumers of the Discovery document) can do on this front. I'll ask internally, but the .NET generator is working as intended.
Ah, too bad :/ Thanks for the reactivity, hoping the team in charge of this ressource will update the $ref
Closing the loop, I've created an internal issue for the API team to look into this. Googlers see: b/379708974
Google.Apis.Admin.Directory.directory_v1.User have some properties generated as object, this is kinda hard to use it properly (set/get require newtonsoft object manipulation) Here, a list of the culprits
I don't fully grasp how this code is generated, and why this result to this :/