Skip to content

12.0.0

Compare
Choose a tag to compare
@jenschude jenschude released this 26 Nov 10:48
· 10 commits to master since this release
205c6f9

What's Changed

  • Update changelog by @ct-sdks in #376
  • Update generated SDKs by @ct-sdks in #377
  • Update generated SDKs by @ct-sdks in #378
  • Update generated SDKs by @ct-sdks in #379
  • Update generated SDKs by @ct-sdks in #380
  • Update generated SDKs by @ct-sdks in #381
  • Version 12.0.0 preparation by @jenschude in #360

Api changes

Changed Property(s)
  • ⚠️ changed property line of type GraphQLErrorLocation from type integer to number
  • ⚠️ changed property column of type GraphQLErrorLocation from type integer to number
  • ⚠️ changed property totalPrice of type StagedOrder from type TypedMoney to CentPrecisionMoney
  • ⚠️ changed property totalPrice of type Order from type TypedMoney to CentPrecisionMoney
Added QueryParameter(s)
  • added query parameter where to method get /{projectKey}/product-selections/key={key}/products
  • added query parameter where to method get /{projectKey}/product-selections/{ID}/products

New Features

  • Improved internal logger

    • the SDKs internal HttpLogger now offers more configuration options like debug/trace logs and different LogLevels
      for specific exception types.

       services.AddSingleton<ILoggerHandlerOptions>(new LoggerHandlerOptions()
       {
           ResponseLogEvent = LogLevel.Information,
           DefaultExceptionLogEvent = LogLevel.Warning,
           ExceptionLogEvents = new Dictionary<System.Type, LogLevel>()
           {
               { typeof(NotFoundException), LogLevel.Information },
               { typeof(ConcurrentModificationException), LogLevel.Information}
           }
       });
  • ClientBuilder class

    • the ClientBuilder replaces the ClientFactory. ClientFactory calls internally invoke ClientBuilder methods
       var client = new ClientBuilder {
                       ClientName = clientName,
                       ClientConfiguration = clientConfiguration,
                       HttpClient = serviceProvider.GetService<IHttpClientFactory>().CreateClient(clientName),
                       SerializerService = serializerFactory(serviceProvider),
                       TokenProvider = tokenProviderSupplier(clientName, configuration, serviceProvider),
                       ReadResponseAsStream = options.ReadResponseAsStream,
                       CorrelationIdProvider = serviceProvider.GetService<ICorrelationIdProvider>(),
                       Middlewares = middlewares
                   }.Build();
  • NotFoundMiddleware

    • This middleware allows to return null in case a resource returns a 404 error instead of throwing an exception

       services.UseCommercetoolsApi(configuration, "Client", options: new ClientOptions() { ReadResponseAsStream = true},middlewares: new List<DelegatingMiddleware>()
       {
           new NotFoundMiddleware()
       });
  • allow adding custom middlewares to the dependency injection setup

BREAKING CHANGES

  • Updated the target framework to .NET 6.0 PR #361
  • HttpVersion is set to 2.0 in the HttpClient instead of the ApiMethod
  • Use Streams for response bodies by default PR #359 - thanks to @Henr1k80
    • The StreamCtpClient is now used by default which reduces the overall CPU & memory footprint significantly
  • Log Format has been changed PR #273
    • The log format has been changed to {HttpMethod} {Uri} {StatusCode} {Timing} {CorrelationId} {ServerTiming}. Log scopes aren't used anymore
    • by default only response information is being logged
    • raising the loglevel to debug logs request information
    • raising to loglevel trace logs request and response bodies

Full Changelog: 11.14.0...12.0.0