CenterEdge / Yardarm

OpenAPI 3 SDK Generator for C#
Apache License 2.0
46 stars 6 forks source link

Create system for registering custom LiteralConverters #269

Closed brantburnett closed 1 week ago

brantburnett commented 1 week ago

Motivation

Extensions may need to control serialization and deserialization of literals beyond the types including in-box.

Modifications

Breaking Changes

The namespace of LiteralSerializer is changed to XXX.Serialization.Literals in generated SDKs.

Results

A more extensible framework for extensions that want to support additional types in headers, path parameters, and query strings. A potential future use is an extension for NodaTime type support.

SDK consumers that need to customize serialization may also do so by mutating the public LiteralConverterRegistry.Instance.

Also fixes a bug deserializing nullable enums from literals.

Resolves #268 Fixes #267

brantburnett commented 1 week ago

/merge