Skip to content

0.5.0

Compare
Choose a tag to compare
@brantburnett brantburnett released this 10 Sep 21:07
· 17 commits to main since this release
4f58807

Major New Features

  • When using Yardarm.SystemTextJson serialization and deserialization now uses a JsonSerializerContext by default for faster startup and serialization
  • When using compatible extensions, including Yardarm.SystemTextJson and Yardarm.MicrosoftExtensionsHttp, the generated SDK is trimming and NativeAOT compatible. This should greatly improve compatibility with Blazor WebAssembly.
  • Binary content types on responses are now exposed as a Stream from GetBodyAsync for easy reading without drilling into Message.Content.
  • Large response bodies, such as binary Stream responses, may now be streamed by setting EnableResponseStreaming to true on the request. Note: Be sure to dispose of the response after reading the stream.
  • Simple object schemas that only have additionalProperties now generate as Dictionary<string, T> models rather than a complex object with an AdditionalProperties property.
  • Support for shared parameters defined on the path rather than the operation
  • Route parameters not explicitly defined in the parameters collection have string properties generated automatically
  • Operations without operationId defined are now skipped by default rather than causing an error
  • Extensions may apply a custom IOperationNameProvider to provide custom naming rules for operations
  • Support for API key authentication on query strings
  • Support for components/requestBodies shared request body definitions

Breaking changes since 0.4

  • The LiteralSerializer, which is used for text/plain content, path parameters, query string parameters, and header parameters no longer uses TypeDescriptor.GetConverter. This allows compatibility with trimming and NativeAOT, but at the expense of compatibility with any type. It now explicitly handles DateTime, DateTimeOffset, TimeSpan, Guid, Uri, String, all common numeric types, and enumerations for deserialization. For serialization, it will also handle any type that implements IFormattable. Other types will now fail.
  • Schemas are no longer generated using the dynamic keyword, all such cases now use object.
  • ITypeSerializer now supports a CancellationToken during deserialization. This may cause extensions to fail if they create custom ITypeSerializer implementations for legacy runtimes that don't support DIMs. A DIM is used to increase compatibility on .NET 6 and later.
  • The generated GetBodyAsync method on operation responses now accepts an optional CancellationToken parameter. This is a binary-level, though not source-level, breaking change in the generated SDKs when upgrading from 0.4 to 0.5.
  • Consumers of generated SDKs may experience a source and binary breaking change upon upgrade if there are any schemas with only additionalProperties that are now represented as plain dictionaries.

What's Changed

Full Changelog: release/0.5.0-beta0002...release/0.5.0