5 types derived from TypeReference
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (5)
Modeler\TypeReference.cs (5)
66
public class ConstantTypeReference :
TypeReference
78
public class TypeModelReference :
TypeReference
89
public class DictionaryTypeReference :
TypeReference
101
public class ArrayTypeReference :
TypeReference
113
public class PrimitiveTypeReference :
TypeReference
198 references to TypeReference
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (198)
DefaultHelpers.cs (4)
64
public static bool IsBlob(
TypeReference
type)
66
return type ==
TypeReference
.File;
70
public static bool IsVoid(
TypeReference
type)
72
return type ==
TypeReference
.Void;
Languages\angular\Angular.cs (73)
16
protected override string ResolveReference(
TypeReference
reference, object[] args)
18
if (reference is
TypeReference
.ConstantTypeReference)
23
if (reference is
TypeReference
.TypeModelReference typeModelRef)
34
if (reference is
TypeReference
.ArrayTypeReference arrayTypeRef)
44
if (reference is
TypeReference
.DictionaryTypeReference dictTypeRef)
49
if (reference ==
TypeReference
.Boolean)
54
if (reference ==
TypeReference
.Int32 ||
55
reference ==
TypeReference
.Int64 ||
56
reference ==
TypeReference
.Float ||
57
reference ==
TypeReference
.Double)
62
if (reference ==
TypeReference
.String || reference ==
TypeReference
.Uuid)
67
if (reference ==
TypeReference
.Date)
72
if (reference ==
TypeReference
.DateTime)
77
if (reference ==
TypeReference
.Void)
82
if (reference ==
TypeReference
.Any)
87
if (reference ==
TypeReference
.File)
92
if (reference ==
TypeReference
.Byte)
105
TypeReference
reference,
108
if (reference is
TypeReference
.TypeModelReference typeModelRef)
128
if (reference is
TypeReference
.ArrayTypeReference arrayTypeRef)
137
if (reference is
TypeReference
.DictionaryTypeReference dictTypeRef)
147
if (reference ==
TypeReference
.Date ||
148
reference ==
TypeReference
.DateTime)
155
if (reference ==
TypeReference
.File)
162
reference is
TypeReference
.ConstantTypeReference ||
163
reference ==
TypeReference
.Boolean ||
164
reference ==
TypeReference
.Int32 ||
165
reference ==
TypeReference
.Int64 ||
166
reference ==
TypeReference
.Float ||
167
reference ==
TypeReference
.Double ||
168
reference ==
TypeReference
.String ||
169
reference ==
TypeReference
.Uuid ||
170
reference ==
TypeReference
.Any)
176
if (reference ==
TypeReference
.Void)
181
if (reference ==
TypeReference
.Byte)
194
TypeReference
reference,
197
if (reference is
TypeReference
.TypeModelReference typeModelRef)
217
if (reference is
TypeReference
.ArrayTypeReference arrayTypeRef)
226
if (reference is
TypeReference
.DictionaryTypeReference dictTypeRef)
236
if (reference ==
TypeReference
.Date ||
237
reference ==
TypeReference
.DateTime)
245
if (reference ==
TypeReference
.File)
252
reference ==
TypeReference
.Boolean ||
253
reference ==
TypeReference
.Int32 ||
254
reference ==
TypeReference
.Int64 ||
255
reference ==
TypeReference
.Float ||
256
reference ==
TypeReference
.Double ||
257
reference ==
TypeReference
.String ||
258
reference ==
TypeReference
.Uuid ||
259
reference ==
TypeReference
.Any)
265
if (reference ==
TypeReference
.Void)
270
if (reference ==
TypeReference
.Byte)
279
public static void Serialize(TextWriter output, object context, Action<TextWriter, object> template,
TypeReference
reference, params object[] args)
281
if (reference ==
TypeReference
.String ||
282
reference is
TypeReference
.ConstantTypeReference ||
283
reference ==
TypeReference
.Date ||
284
reference ==
TypeReference
.DateTime)
291
reference ==
TypeReference
.Boolean ||
292
reference ==
TypeReference
.Int32 ||
293
reference ==
TypeReference
.Int64 ||
294
reference ==
TypeReference
.Float ||
295
reference ==
TypeReference
.Double)
309
public static void Deserialize(TextWriter output, object context, Action<TextWriter, object> template,
TypeReference
reference, params object[] args)
311
if (reference ==
TypeReference
.String ||
312
reference is
TypeReference
.ConstantTypeReference ||
313
reference ==
TypeReference
.Date ||
314
reference ==
TypeReference
.DateTime)
321
reference ==
TypeReference
.Boolean ||
322
reference ==
TypeReference
.Int32 ||
323
reference ==
TypeReference
.Int64 ||
324
reference ==
TypeReference
.Float ||
325
reference ==
TypeReference
.Double)
Languages\csharp\CSharp.cs (41)
7
using TypeReference = Microsoft.DotNet.SwaggerGenerator.Modeler.
TypeReference
;
24
public static bool IsNullableType(
TypeReference
reference)
26
if (reference ==
TypeReference
.Boolean)
31
if (reference ==
TypeReference
.Int32)
36
if (reference ==
TypeReference
.Int64)
41
if (reference ==
TypeReference
.Float)
46
if (reference ==
TypeReference
.Double)
51
if (reference ==
TypeReference
.Date)
56
if (reference ==
TypeReference
.DateTime)
61
if (reference ==
TypeReference
.Uuid)
71
protected override string ResolveReference(
TypeReference
reference, object[] args)
73
if (reference is
TypeReference
.ConstantTypeReference)
78
if (reference is
TypeReference
.TypeModelReference typeModelRef)
83
if (reference is
TypeReference
.ArrayTypeReference arrayTypeRef)
88
if (reference is
TypeReference
.DictionaryTypeReference dictTypeRef)
93
if (reference ==
TypeReference
.Boolean)
98
if (reference ==
TypeReference
.Int32)
103
if (reference ==
TypeReference
.Int64)
108
if (reference ==
TypeReference
.Float)
113
if (reference ==
TypeReference
.Double)
118
if (reference ==
TypeReference
.String)
123
if (reference ==
TypeReference
.Date)
128
if (reference ==
TypeReference
.DateTime)
133
if (reference ==
TypeReference
.Uuid)
138
if (reference ==
TypeReference
.Void)
143
if (reference ==
TypeReference
.Any)
148
if (reference ==
TypeReference
.File)
153
if (reference ==
TypeReference
.Byte)
162
public void NullCheck(TextWriter output, object context, Action<TextWriter, object> template,
TypeReference
reference, bool required)
164
if (reference ==
TypeReference
.String)
178
public void NotNullCheck(TextWriter output, object context, Action<TextWriter, object> template,
TypeReference
reference, bool required)
180
if (reference ==
TypeReference
.String)
193
public string GetDefaultExpression(
TypeReference
reference, bool required)
242
if (type is
TypeReference
.TypeModelReference modelRef)
255
public bool IsNullable(
TypeReference
type)
258
type is
TypeReference
.ArrayTypeReference ||
259
type is
TypeReference
.DictionaryTypeReference ||
260
type is
TypeReference
.TypeModelReference ||
261
type ==
TypeReference
.Any ||
262
type ==
TypeReference
.File ||
263
type ==
TypeReference
.String)
Languages\Language.cs (3)
69
public string TypeRef(
TypeReference
reference, params object[] args)
75
/// Gets the source code representation of the given <see cref="
TypeReference
"/>
77
protected abstract string ResolveReference(
TypeReference
reference, object[] args);
Modeler\ClassTypeModel.cs (2)
13
TypeReference
additionalProperties)
24
public
TypeReference
AdditionalProperties { get; }
Modeler\MethodModel.cs (8)
16
TypeReference
responseType,
17
TypeReference
errorType,
34
public
TypeReference
ResponseType { get; }
35
public
TypeReference
ErrorType { get; }
40
public bool ResponseIsVoid => ResponseType ==
TypeReference
.Void;
42
public bool ResponseIsFile => ResponseType ==
TypeReference
.File;
45
Parameters.Where(p => p.Type is
TypeReference
.ConstantTypeReference).OrderBy(p => p.Name);
48
Parameters.Where(p => !(p.Type is
TypeReference
.ConstantTypeReference)).OrderBy(p => p.Name);
Modeler\ParameterModel.cs (4)
7
public ParameterModel(string name, bool required, ParameterLocation? location,
TypeReference
type)
18
public
TypeReference
Type { get; }
19
public bool IsConstant => Type is
TypeReference
.ConstantTypeReference;
20
public bool IsArray => Type is
TypeReference
.ArrayTypeReference;
Modeler\PropertyModel.cs (2)
5
public PropertyModel(string name, bool required, bool readOnly,
TypeReference
type)
16
public
TypeReference
Type { get; }
Modeler\ServiceClientModelFactory.cs (30)
168
TypeReference
errorType = null;
175
TypeReference
responseType = null;
185
responseType =
TypeReference
.Void;
190
if (responseType is
TypeReference
.ArrayTypeReference &&
201
private
TypeReference
ResolveTypeForResponse(OpenApiResponse response, string name)
241
TypeReference
type = ResolveType(body.Content["application/json"].Schema);
251
TypeReference
type = ResolveType(parameter.Schema);
256
private
TypeReference
ResolveType(OpenApiSchema schema)
260
return
TypeReference
.Void;
277
return
TypeReference
.Boolean;
282
return
TypeReference
.Int32;
285
return
TypeReference
.Int64;
291
return
TypeReference
.Float;
294
return
TypeReference
.Double;
301
return
TypeReference
.Constant(enumeration[0]);
326
return
TypeReference
.Object(ResolveEnumTypeModel(enumeration, enumName));
332
return
TypeReference
.Byte;
334
return
TypeReference
.Date;
336
return
TypeReference
.DateTime;
338
return
TypeReference
.Uuid;
340
return
TypeReference
.String;
343
return
TypeReference
.Array(ResolveType(items));
349
return
TypeReference
.Dictionary(ResolveType(schema.AdditionalProperties));
354
return
TypeReference
.Any;
357
return
TypeReference
.Object(ResolveTypeModel(schema));
359
return
TypeReference
.File;
361
return
TypeReference
.Any;
381
private
TypeReference
ResolveType(OpenApiSchema schema, string operationId)
429
TypeReference
additionalProperties;
443
var
propertyType = ResolveType(type);
Modeler\TypeReference.cs (31)
7
private static readonly ConditionalWeakTable<
TypeReference
,
TypeReference
> ArrayTypeReferences =
8
new ConditionalWeakTable<
TypeReference
,
TypeReference
>();
10
private static readonly ConditionalWeakTable<TypeModel,
TypeReference
> TypeModelReferences =
11
new ConditionalWeakTable<TypeModel,
TypeReference
>();
13
public static readonly
TypeReference
Boolean = new PrimitiveTypeReference("boolean");
14
public static readonly
TypeReference
Int32 = new PrimitiveTypeReference("int32");
15
public static readonly
TypeReference
Int64 = new PrimitiveTypeReference("int64");
16
public static readonly
TypeReference
Float = new PrimitiveTypeReference("float");
17
public static readonly
TypeReference
Double = new PrimitiveTypeReference("double");
18
public static readonly
TypeReference
String = new PrimitiveTypeReference("string");
19
public static readonly
TypeReference
Byte = new PrimitiveTypeReference("byte");
20
public static readonly
TypeReference
Date = new PrimitiveTypeReference("date");
21
public static readonly
TypeReference
DateTime = new PrimitiveTypeReference("date-time");
22
public static readonly
TypeReference
Uuid = new PrimitiveTypeReference("uuid");
23
public static readonly
TypeReference
File = new PrimitiveTypeReference("file");
24
public static readonly
TypeReference
Void = new PrimitiveTypeReference("void");
25
public static readonly
TypeReference
Any = new PrimitiveTypeReference("any");
34
public static
TypeReference
Array(
TypeReference
baseType)
36
if (!ArrayTypeReferences.TryGetValue(baseType, out
TypeReference
reference))
45
public static
TypeReference
Object(TypeModel typeModel)
47
if (!TypeModelReferences.TryGetValue(typeModel, out
TypeReference
reference))
56
public static
TypeReference
Constant(string value)
61
public static
TypeReference
Dictionary(
TypeReference
valueType)
91
public DictionaryTypeReference(
TypeReference
valueType)
97
public
TypeReference
ValueType { get; }
103
public ArrayTypeReference(
TypeReference
baseType)
109
public
TypeReference
BaseType { get; }