forked from CoreWCF/CoreWCF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExampleContract.cs
37 lines (31 loc) · 1.42 KB
/
ExampleContract.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Runtime.Serialization;
using CoreWCF.OpenApi.Attributes;
namespace WebHttp
{
[DataContract(Name = "ExampleContract", Namespace = "http://example.com")]
internal class ExampleContract
{
[DataMember(Name = "SimpleProperty", Order = 1)]
[OpenApiProperty(Description = "SimpleProperty description.")]
public string SimpleProperty { get; set; }
[DataMember(Name = "ComplexProperty", Order = 2)]
[OpenApiProperty(Description = "ComplexProperty description.")]
public InnerExampleContract ComplexProperty { get; set; }
[DataMember(Name = "SimpleCollection", Order = 3)]
[OpenApiProperty(Description = "SimpleCollection description.")]
public List<string> SimpleCollection { get; set; }
[DataMember(Name = "ComplexCollection", Order = 4)]
[OpenApiProperty(Description = "ComplexCollection description.")]
public List<InnerExampleContract> ComplexCollection { get; set; }
}
[DataContract(Name = "InnerExampleResponse", Namespace = "http://example.com")]
internal class InnerExampleContract
{
[DataMember(Name = "Name", Order = 1)]
[OpenApiProperty(Description = "Name description.")]
public string Name { get; set; }
}
}