public static JArray Parameter(this JArray parameters, string name, string kind, string description, Microsoft.OData.Edm.IEdmType type, bool?required) { var parameter = new JObject() { { "name", name }, { "in", kind }, { "description", description }, }; if (kind != "body") { OData4.SetSwaggerType(parameter, type); } else { var schema = new JObject(); OData4.SetSwaggerType(schema, type); parameter.Add("schema", schema); } if (required != null) { parameter.Add("required", required); } parameters.Add(parameter); return(parameters); }
public static JObject Response(this JObject responses, string name, string description, Microsoft.OData.Edm.IEdmType type) { var schema = new JObject(); OData4.SetSwaggerType(schema, type); responses.Add(name, new JObject() { { "description", description }, { "schema", schema } }); return(responses); }
public static JArray Parameter(this JArray parameters, string name, string kind, string description, Microsoft.OData.Edm.IEdmType type) { return(Parameter(parameters, name, kind, description, type, required: null)); }