Closed twadevs closed 2 years ago
Do you mind sharing the whole JSON from API + the generated strongly-type model? It would help us with the investigation.
Hi!
This issue has gone quiet. 👻
It’s been a while since the last update here. If we missed anything on this issue or if you want to keep it open, please reply here.
Thanks for being a part of the Kontent.ai community!
Just an update, if it helps, we eventually figured out what was going on:
We use the Kentico Model Generator to create the .Net models, but we used the same syntax in the CLI that we used in V1, which still generates models, but is entirely different to the new version. I assume this is for backward compatibility with Management API V1?
E.g. this is what we used in the CLI (and it still worked, generated models):
kontentModelGenerator.exe --projectid "<project id>" --contentmanagementapi true --namespace "TWA.Library.Models.Kentico.Management" --outputdir "<repo>\TWA.Library\Models\Kentico\Management"
But the new version expects the following argument instead:
--managementapi true
Happy to hear that you were able to find a solution!
This info could be interesting for @Sevitas
Hi, we have made some improvements in the latest version of the Generators SDK, renaming the parameter --contentmanagementapi to --managementapi was one of them. If you need to generate the Management models, you need to use the new parameter, otherwise the default value will be used and Delivery models will be generated. We have created a feature request which should clear up the confusion. What do you think about it @twadevs?
Thanks @Sevitas , sounds good. I think an error message would be great.
What I'm trying to do:
Hi,
I'm trying to use the
.GetLanguageVariantAsync<T>
method to retrieve strongly typed items. It seems to return the Item object (id, etc..) and last updated, etc.., but the Elements are all null.Using the LanguageVariantModel without the strongly typed object works fine.
Repro steps
client.GetLanguageVariantAsync<T>
method to retrieve the language variantExpected behaviour
The strongly typed object should include values for the Elements.
Test environment
Screenshots