5 types derived from TypeReference
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (5)
Modeler\TypeReference.cs (5)
69
public class ConstantTypeReference :
TypeReference
81
public class TypeModelReference :
TypeReference
92
public class DictionaryTypeReference :
TypeReference
104
public class ArrayTypeReference :
TypeReference
116
public class PrimitiveTypeReference :
TypeReference
198 references to TypeReference
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (198)
DefaultHelpers.cs (4)
67
public static bool IsBlob(
TypeReference
type)
69
return type ==
TypeReference
.File;
73
public static bool IsVoid(
TypeReference
type)
75
return type ==
TypeReference
.Void;
Languages\angular\Angular.cs (73)
19
protected override string ResolveReference(
TypeReference
reference, object[] args)
21
if (reference is
TypeReference
.ConstantTypeReference)
26
if (reference is
TypeReference
.TypeModelReference typeModelRef)
37
if (reference is
TypeReference
.ArrayTypeReference arrayTypeRef)
47
if (reference is
TypeReference
.DictionaryTypeReference dictTypeRef)
52
if (reference ==
TypeReference
.Boolean)
57
if (reference ==
TypeReference
.Int32 ||
58
reference ==
TypeReference
.Int64 ||
59
reference ==
TypeReference
.Float ||
60
reference ==
TypeReference
.Double)
65
if (reference ==
TypeReference
.String || reference ==
TypeReference
.Uuid)
70
if (reference ==
TypeReference
.Date)
75
if (reference ==
TypeReference
.DateTime)
80
if (reference ==
TypeReference
.Void)
85
if (reference ==
TypeReference
.Any)
90
if (reference ==
TypeReference
.File)
95
if (reference ==
TypeReference
.Byte)
108
TypeReference
reference,
111
if (reference is
TypeReference
.TypeModelReference typeModelRef)
131
if (reference is
TypeReference
.ArrayTypeReference arrayTypeRef)
140
if (reference is
TypeReference
.DictionaryTypeReference dictTypeRef)
150
if (reference ==
TypeReference
.Date ||
151
reference ==
TypeReference
.DateTime)
158
if (reference ==
TypeReference
.File)
165
reference is
TypeReference
.ConstantTypeReference ||
166
reference ==
TypeReference
.Boolean ||
167
reference ==
TypeReference
.Int32 ||
168
reference ==
TypeReference
.Int64 ||
169
reference ==
TypeReference
.Float ||
170
reference ==
TypeReference
.Double ||
171
reference ==
TypeReference
.String ||
172
reference ==
TypeReference
.Uuid ||
173
reference ==
TypeReference
.Any)
179
if (reference ==
TypeReference
.Void)
184
if (reference ==
TypeReference
.Byte)
197
TypeReference
reference,
200
if (reference is
TypeReference
.TypeModelReference typeModelRef)
220
if (reference is
TypeReference
.ArrayTypeReference arrayTypeRef)
229
if (reference is
TypeReference
.DictionaryTypeReference dictTypeRef)
239
if (reference ==
TypeReference
.Date ||
240
reference ==
TypeReference
.DateTime)
248
if (reference ==
TypeReference
.File)
255
reference ==
TypeReference
.Boolean ||
256
reference ==
TypeReference
.Int32 ||
257
reference ==
TypeReference
.Int64 ||
258
reference ==
TypeReference
.Float ||
259
reference ==
TypeReference
.Double ||
260
reference ==
TypeReference
.String ||
261
reference ==
TypeReference
.Uuid ||
262
reference ==
TypeReference
.Any)
268
if (reference ==
TypeReference
.Void)
273
if (reference ==
TypeReference
.Byte)
282
public static void Serialize(TextWriter output, object context, Action<TextWriter, object> template,
TypeReference
reference, params object[] args)
284
if (reference ==
TypeReference
.String ||
285
reference is
TypeReference
.ConstantTypeReference ||
286
reference ==
TypeReference
.Date ||
287
reference ==
TypeReference
.DateTime)
294
reference ==
TypeReference
.Boolean ||
295
reference ==
TypeReference
.Int32 ||
296
reference ==
TypeReference
.Int64 ||
297
reference ==
TypeReference
.Float ||
298
reference ==
TypeReference
.Double)
312
public static void Deserialize(TextWriter output, object context, Action<TextWriter, object> template,
TypeReference
reference, params object[] args)
314
if (reference ==
TypeReference
.String ||
315
reference is
TypeReference
.ConstantTypeReference ||
316
reference ==
TypeReference
.Date ||
317
reference ==
TypeReference
.DateTime)
324
reference ==
TypeReference
.Boolean ||
325
reference ==
TypeReference
.Int32 ||
326
reference ==
TypeReference
.Int64 ||
327
reference ==
TypeReference
.Float ||
328
reference ==
TypeReference
.Double)
Languages\csharp\CSharp.cs (41)
10
using TypeReference = Microsoft.DotNet.SwaggerGenerator.Modeler.
TypeReference
;
27
public static bool IsNullableType(
TypeReference
reference)
29
if (reference ==
TypeReference
.Boolean)
34
if (reference ==
TypeReference
.Int32)
39
if (reference ==
TypeReference
.Int64)
44
if (reference ==
TypeReference
.Float)
49
if (reference ==
TypeReference
.Double)
54
if (reference ==
TypeReference
.Date)
59
if (reference ==
TypeReference
.DateTime)
64
if (reference ==
TypeReference
.Uuid)
74
protected override string ResolveReference(
TypeReference
reference, object[] args)
76
if (reference is
TypeReference
.ConstantTypeReference)
81
if (reference is
TypeReference
.TypeModelReference typeModelRef)
86
if (reference is
TypeReference
.ArrayTypeReference arrayTypeRef)
91
if (reference is
TypeReference
.DictionaryTypeReference dictTypeRef)
96
if (reference ==
TypeReference
.Boolean)
101
if (reference ==
TypeReference
.Int32)
106
if (reference ==
TypeReference
.Int64)
111
if (reference ==
TypeReference
.Float)
116
if (reference ==
TypeReference
.Double)
121
if (reference ==
TypeReference
.String)
126
if (reference ==
TypeReference
.Date)
131
if (reference ==
TypeReference
.DateTime)
136
if (reference ==
TypeReference
.Uuid)
141
if (reference ==
TypeReference
.Void)
146
if (reference ==
TypeReference
.Any)
151
if (reference ==
TypeReference
.File)
156
if (reference ==
TypeReference
.Byte)
165
public void NullCheck(TextWriter output, object context, Action<TextWriter, object> template,
TypeReference
reference, bool required)
167
if (reference ==
TypeReference
.String)
181
public void NotNullCheck(TextWriter output, object context, Action<TextWriter, object> template,
TypeReference
reference, bool required)
183
if (reference ==
TypeReference
.String)
196
public string GetDefaultExpression(
TypeReference
reference, bool required)
245
if (type is
TypeReference
.TypeModelReference modelRef)
258
public bool IsNullable(
TypeReference
type)
261
type is
TypeReference
.ArrayTypeReference ||
262
type is
TypeReference
.DictionaryTypeReference ||
263
type is
TypeReference
.TypeModelReference ||
264
type ==
TypeReference
.Any ||
265
type ==
TypeReference
.File ||
266
type ==
TypeReference
.String)
Languages\Language.cs (3)
72
public string TypeRef(
TypeReference
reference, params object[] args)
78
/// Gets the source code representation of the given <see cref="
TypeReference
"/>
80
protected abstract string ResolveReference(
TypeReference
reference, object[] args);
Modeler\ClassTypeModel.cs (2)
16
TypeReference
additionalProperties)
27
public
TypeReference
AdditionalProperties { get; }
Modeler\MethodModel.cs (8)
19
TypeReference
responseType,
20
TypeReference
errorType,
37
public
TypeReference
ResponseType { get; }
38
public
TypeReference
ErrorType { get; }
43
public bool ResponseIsVoid => ResponseType ==
TypeReference
.Void;
45
public bool ResponseIsFile => ResponseType ==
TypeReference
.File;
48
Parameters.Where(p => p.Type is
TypeReference
.ConstantTypeReference).OrderBy(p => p.Name);
51
Parameters.Where(p => !(p.Type is
TypeReference
.ConstantTypeReference)).OrderBy(p => p.Name);
Modeler\ParameterModel.cs (4)
10
public ParameterModel(string name, bool required, ParameterLocation? location,
TypeReference
type)
21
public
TypeReference
Type { get; }
22
public bool IsConstant => Type is
TypeReference
.ConstantTypeReference;
23
public bool IsArray => Type is
TypeReference
.ArrayTypeReference;
Modeler\PropertyModel.cs (2)
8
public PropertyModel(string name, bool required, bool readOnly,
TypeReference
type)
19
public
TypeReference
Type { get; }
Modeler\ServiceClientModelFactory.cs (30)
171
TypeReference
errorType = null;
178
TypeReference
responseType = null;
188
responseType =
TypeReference
.Void;
193
if (responseType is
TypeReference
.ArrayTypeReference &&
204
private
TypeReference
ResolveTypeForResponse(OpenApiResponse response, string name)
244
TypeReference
type = ResolveType(body.Content["application/json"].Schema);
254
TypeReference
type = ResolveType(parameter.Schema);
259
private
TypeReference
ResolveType(OpenApiSchema schema)
263
return
TypeReference
.Void;
280
return
TypeReference
.Boolean;
285
return
TypeReference
.Int32;
288
return
TypeReference
.Int64;
294
return
TypeReference
.Float;
297
return
TypeReference
.Double;
304
return
TypeReference
.Constant(enumeration[0]);
329
return
TypeReference
.Object(ResolveEnumTypeModel(enumeration, enumName));
335
return
TypeReference
.Byte;
337
return
TypeReference
.Date;
339
return
TypeReference
.DateTime;
341
return
TypeReference
.Uuid;
343
return
TypeReference
.String;
346
return
TypeReference
.Array(ResolveType(items));
352
return
TypeReference
.Dictionary(ResolveType(schema.AdditionalProperties));
357
return
TypeReference
.Any;
360
return
TypeReference
.Object(ResolveTypeModel(schema));
362
return
TypeReference
.File;
364
return
TypeReference
.Any;
384
private
TypeReference
ResolveType(OpenApiSchema schema, string operationId)
432
TypeReference
additionalProperties;
446
var
propertyType = ResolveType(type);
Modeler\TypeReference.cs (31)
10
private static readonly ConditionalWeakTable<
TypeReference
,
TypeReference
> ArrayTypeReferences =
11
new ConditionalWeakTable<
TypeReference
,
TypeReference
>();
13
private static readonly ConditionalWeakTable<TypeModel,
TypeReference
> TypeModelReferences =
14
new ConditionalWeakTable<TypeModel,
TypeReference
>();
16
public static readonly
TypeReference
Boolean = new PrimitiveTypeReference("boolean");
17
public static readonly
TypeReference
Int32 = new PrimitiveTypeReference("int32");
18
public static readonly
TypeReference
Int64 = new PrimitiveTypeReference("int64");
19
public static readonly
TypeReference
Float = new PrimitiveTypeReference("float");
20
public static readonly
TypeReference
Double = new PrimitiveTypeReference("double");
21
public static readonly
TypeReference
String = new PrimitiveTypeReference("string");
22
public static readonly
TypeReference
Byte = new PrimitiveTypeReference("byte");
23
public static readonly
TypeReference
Date = new PrimitiveTypeReference("date");
24
public static readonly
TypeReference
DateTime = new PrimitiveTypeReference("date-time");
25
public static readonly
TypeReference
Uuid = new PrimitiveTypeReference("uuid");
26
public static readonly
TypeReference
File = new PrimitiveTypeReference("file");
27
public static readonly
TypeReference
Void = new PrimitiveTypeReference("void");
28
public static readonly
TypeReference
Any = new PrimitiveTypeReference("any");
37
public static
TypeReference
Array(
TypeReference
baseType)
39
if (!ArrayTypeReferences.TryGetValue(baseType, out
TypeReference
reference))
48
public static
TypeReference
Object(TypeModel typeModel)
50
if (!TypeModelReferences.TryGetValue(typeModel, out
TypeReference
reference))
59
public static
TypeReference
Constant(string value)
64
public static
TypeReference
Dictionary(
TypeReference
valueType)
94
public DictionaryTypeReference(
TypeReference
valueType)
100
public
TypeReference
ValueType { get; }
106
public ArrayTypeReference(
TypeReference
baseType)
112
public
TypeReference
BaseType { get; }