Aktivity „alex@livemobility.com“

Hi, Thanks for the support. In the meantime I should use your provided solution with MyAbpStringToEnumConverter ?

Hi,

Thanks for your analysis. This solution only fixes the swagger UI, which now shows Enums as strings, but the serialization is still done as int. An example below, that property should have been returned as a string.

In a vanilla asp core + swagger project, this is fixed by using
services.AddControllers().AddJsonOptions(options => { options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); });

I created a new zip:

Hi, yes there is

Hi, sorry about posting the project to the wrong ticket.

I checked the build and it looks like you guys didn't fix the base template ( I reported a bug regarding this a long time ago )

Please change in Acme.BookStore.HttpApi.Host.csproj

<ItemGroup> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX" Version="3.0.-" /> </ItemGroup>

to <ItemGroup> <PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX" Version="3.0.0" /> </ItemGroup>

Hi

Hi,

I waas trying to say that this documentation is not up to date: https://docs.abp.io/en/abp/latest/Testing

Hi,

Thanks for the initial input

I added this in

        context.Services.AddOptions&lt;JsonOptions&gt;()
      .Configure&lt;IServiceProvider&gt;((options, rootServiceProvider) =>
      {
          options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
      });

in ConfigureServices, at the end. Still, this didn't transform the enums into strings

Hi,

thanks for the input. Your statement contradicts a bit what we have here: https://docs.abp.io/en/abp/latest/Tutorials/Part-4?UI=NG&DB=EF#testing-the-bookappservice

Also, this documentation is not up to date: https://docs.abp.io/en/abp/latest/Testing

Is it possible to get some explanation about why there was a change in approach?

Hi,

Try to run TestAppServiceTests~Initial_Data_Should_Contain_Admin_User

you will see exception: Message:  Volo.Abp.AbpInitializationException : An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module Acme.BookStore.BookStoreTestBaseModule, Acme.BookStore.TestBase, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: An exception was thrown while activating Volo.Abp.Identity.IdentityDataSeedContributor -> Volo.Abp.Identity.IdentityDataSeeder.. See the inner exception for details. ---- Autofac.Core.DependencyResolutionException : An exception was thrown while activating Volo.Abp.Identity.IdentityDataSeedContributor -> Volo.Abp.Identity.IdentityDataSeeder. -------- Autofac.Core.DependencyResolutionException : None of the constructors found on type 'Volo.Abp.Identity.IdentityDataSeeder' can be invoked with the available services and parameters: Cannot resolve parameter 'Volo.Abp.Identity.IIdentityRoleRepository roleRepository' of constructor 'Void .ctor(Volo.Abp.Guids.IGuidGenerator, Volo.Abp.Identity.IIdentityRoleRepository, Volo.Abp.Identity.IIdentityUserRepository, Microsoft.AspNetCore.Identity.ILookupNormalizer, Volo.Abp.Identity.IdentityUserManager, Volo.Abp.Identity.IdentityRoleManager, Volo.Abp.MultiTenancy.ICurrentTenant, Microsoft.Extensions.Options.IOptions`1[Microsoft.AspNetCore.Identity.IdentityOptions])'.

The issue is that now we have to implement the appservice tests as abstract, creata a new class in Acme.BookStore.EntityFrameworkCore.Tests and run tests from there

If this is the new approach, it's fine but an explanation and updated documentation would be fine :)

Zobrazených 1 až 10 z 18 záznamov
Made with ❤️ on ABP v8.2.0-preview Updated on marca 25, 2024, 15:11