The objects we are inserting are flexible because the user couldn't decide what parameters they wanted per item. This has made it interesting to ensure Swagger displays the information needed for the frontend developers. I am currently creating an "object" that has the example defined. The "object" is the same for every item with only the example changing. Is there a way to do a type of case statement for the example so I don't have to have several copies of the same object?
[HttpPost("getsources")]
[ProducesResponseType(typeof(SourceMaterialResponse), StatusCodes.Status200OK)]
public ActionResult GetSources([FromBody] FilterSourceInput filters)
{ .... }
public class SourceMaterialResponse
{
public bool success { get; set; }
public string message { get; set; }
/// <summary>
/// The array of Parameter Definitions in the format "Column Name" : "Value"
/// </summary>
/// <example>"Definition": "Source vendor name if commercially obtained"</example>
public List<Parameter_Definition> parameters { get; set; }
/// <summary>
/// The array of Sources in the format "Column Name" : "Value"
/// </summary>
/// <example> S{
/// "SourceID": "",
/// "MaterialID": "",
/// "Comments": "The most common form of Aluminum used in aircraft",
/// "CeramicOrGlassReinforced": "",
/// "CeramicOrGlassComposition": "",
/// "PlasticElastomer": "",
/// "MaterialDescription": "This is an aluminium alloy, with copper as the primary alloying element",
/// "PlasticComposition": "",
/// "OrganicPolymerCompositeCoreForm": "",
/// "NaturalType": "",
/// "OrganicPolymerCompositeMatrix": "",
/// "MaterialName": "Susan Alloy",
/// "MaterialClassOrType": "Metal",
/// "OrganicPolymerCompositeFiber": "",
/// "OrganicPolymerCompositeCore": "",
/// "MetalCompositionOrAlloy": "Copper"
/// }</example>
public List<Dictionary<string, string>> items { get; set; }
}