Skip to content

Instantly share code, notes, and snippets.

View leedm777's full-sized avatar

David M. Lee leedm777

View GitHub Profile
@leedm777
leedm777 / swagger-type-variance.md
Last active December 13, 2021 08:19
Type variance in Swagger models

This document describes how to extend Swagger data models to allow the types of fields to vary.

Given that Swagger models need to map cleanly to a statically typed object model, a subclassing approach seems like it would be a good fit.

Inheritance

Inheritance allows a model (the derived type) to inherit all of the