forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMetadataTypes.cs
More file actions
144 lines (127 loc) · 4.92 KB
/
MetadataTypes.cs
File metadata and controls
144 lines (127 loc) · 4.92 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
using System.Collections.Generic;
namespace ServiceStack
{
public class MetadataTypesConfig
{
public MetadataTypesConfig() {}
public MetadataTypesConfig(
string baseUrl = null,
bool makePartial = true,
bool makeVirtual = true,
bool addReturnMarker = true,
bool convertDescriptionToComments = true,
bool addDataContractAttributes = false,
bool makeDataContractsExtensible = false,
bool addIndexesToDataMembers = false,
string addDefaultXmlNamespace = null,
bool initializeCollections = true,
bool addResponseStatus = false,
int? addImplicitVersion = null)
{
BaseUrl = baseUrl;
MakePartial = makePartial;
MakeVirtual = makeVirtual;
AddReturnMarker = addReturnMarker;
AddDescriptionAsComments = convertDescriptionToComments;
AddDataContractAttributes = addDataContractAttributes;
AddDefaultXmlNamespace = addDefaultXmlNamespace;
MakeDataContractsExtensible = makeDataContractsExtensible;
AddIndexesToDataMembers = addIndexesToDataMembers;
InitializeCollections = initializeCollections;
AddResponseStatus = addResponseStatus;
AddImplicitVersion = addImplicitVersion;
DefaultNamespaces = new List<string>
{
"System",
"System.Collections",
"System.ComponentModel",
"System.Collections.Generic",
"System.Runtime.Serialization",
"ServiceStack.ServiceHost",
"ServiceStack.ServiceInterface.ServiceModel",
};
}
public string BaseUrl { get; set; }
public bool MakePartial { get; set; }
public bool MakeVirtual { get; set; }
public bool AddReturnMarker { get; set; }
public bool AddDescriptionAsComments { get; set; }
public bool AddDataContractAttributes { get; set; }
public bool MakeDataContractsExtensible { get; set; }
public bool AddIndexesToDataMembers { get; set; }
public bool InitializeCollections { get; set; }
public int? AddImplicitVersion { get; set; }
public bool AddResponseStatus { get; set; }
public string AddDefaultXmlNamespace { get; set; }
public List<string> DefaultNamespaces { get; set; }
}
public class MetadataTypes
{
public MetadataTypes()
{
Types = new List<MetadataType>();
Operations = new List<MetadataOperationType>();
Version = 1;
}
public int Version { get; set; }
public MetadataTypesConfig Config { get; set; }
public List<MetadataType> Types { get; set; }
public List<MetadataOperationType> Operations { get; set; }
}
public class MetadataOperationType
{
public List<string> Actions { get; set; }
public MetadataType Request { get; set; }
public MetadataType Response { get; set; }
}
public class MetadataType
{
public string Name { get; set; }
public string Namespace { get; set; }
public string[] GenericArgs { get; set; }
public string Inherits { get; set; }
public string[] InheritsGenericArgs { get; set; }
public string Description { get; set; }
public bool ReturnVoidMarker { get; set; }
public string[] ReturnMarkerGenericArgs { get; set; }
public List<MetadataRoute> Routes { get; set; }
public MetadataDataContract DataContract { get; set; }
public List<MetadataPropertyType> Properties { get; set; }
public List<MetadataAttribute> Attributes { get; set; }
}
public class MetadataRoute
{
public string Path { get; set; }
public string Verbs { get; set; }
public string Notes { get; set; }
public string Summary { get; set; }
}
public class MetadataDataContract
{
public string Name { get; set; }
public string Namespace { get; set; }
}
public class MetadataDataMember
{
public string Name { get; set; }
public int? Order { get; set; }
public bool? IsRequired { get; set; }
public bool? EmitDefaultValue { get; set; }
}
public class MetadataPropertyType
{
public string Name { get; set; }
public string Type { get; set; }
public string[] GenericArgs { get; set; }
public string Value { get; set; }
public string Description { get; set; }
public MetadataDataMember DataMember { get; set; }
public List<MetadataAttribute> Attributes { get; set; }
}
public class MetadataAttribute
{
public string Name { get; set; }
public List<MetadataPropertyType> ConstructorArgs { get; set; }
public List<MetadataPropertyType> Args { get; set; }
}
}