示例#1
0
 public static ParameterObject Create(Core.Model.Parameter parameter)
 => new ParameterObject(
     name: parameter.SerializedName,
     @in: parameter.Location.ToString().ToLower(),
     required: parameter.IsRequired,
     xMsSkipUrlEncoding: parameter.XMsSkipUrlEncoding(),
     schema:
     parameter.IsConstant
                 ? SchemaObject.Const(parameter.ModelType, parameter.DefaultValue)
             : parameter.IsApiVersion()
                 ? SchemaObject.Const(parameter.ModelType, parameter.Method.CodeModel.ApiVersion)
                 : SchemaObject.Create(parameter.ModelType));
示例#2
0
 private ParameterObject(
     string name,
     string @in,
     bool required,
     bool xMsSkipUrlEncoding,
     SchemaObject schema)
 {
     Name               = name;
     In                 = @in;
     Required           = required;
     XMsSkipUrlEncoding = xMsSkipUrlEncoding;
     Schema             = schema;
 }
示例#3
0
 public static ResponseObject Create(Core.Model.Response response)
 => new ResponseObject(SchemaObject.Create(response.Body));
示例#4
0
 public ResponseObject(SchemaObject schema)
 {
     Schema = schema;
 }
示例#5
0
 public static Object <SchemaObject> Create(IEnumerable <CompositeType> modelTypes)
 => Json.Object(modelTypes.Select(type => Json.Property(
                                      type.SerializedName,
                                      SchemaObject.CreateDefinition(type))));