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