CenterEdge / Yardarm

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

Treat simple additional properties objects as dictionaries #235

Closed brantburnett closed 3 months ago

brantburnett commented 3 months ago

Motivation

The current structure for additional properties on objects is difficult for consumers to use. They must deal with type casting and the specific dynamic implementations of each serialization library (JElement or JsonElement, etc). For cases where the object is ONLY made up of additional properties, without any explicitly defined properties, this can be made much simpler by representing it is as dictionary with string keys. In particular, if a schema is defined for the values of the additional properties this can be directly represented as a strong type on the dictionary value.

Modifications

Results

Resolves #203