我有一个由 Swashbuckle 从我的 Web Api 服务生成的 swagger 元数据文件。当我尝试生成 Azure API 应用程序客户端(使用 Visual Studio 2015 > 添加 > Azure API 应用程序客户端 > Swagger 元数据文件时,会引发以下错误:
Generating client code and adding to project started
Generate client code for Microsoft Azure API App with following parameters:
Microsoft Azure API App Name: Contoso.Api1, Base namespace: Automation.Http, Metadata file path: C:\Users\contoso\Desktop\swagger_current.json
[Info]AutoRest Core 0.9.7.0
[Info]Initializing code generator.
[Info]Successfully initialized CSharp Code Generator 1.0.5584.22489
[Info]Initializing modeler.
[Info]Successfully initialized Swagger Modeler 1.0.5584.22490
[Info]Parsing swagger json file.
[Info]Generating client model from swagger model.
[Info]Initializing code generator.
[Info]Successfully initialized CSharp Code Generator 1.0.5584.22489
[Fatal]Error generating syntax tree: Failure during generation of method PutItem.
Failure during serialization generation of method PutItem.
System.NotSupportedException: Contoso.Api.Types.ContosoModel - False
System.NotSupportedException: Contoso.Api.Types.ContosoModel - False
at Hyak.SerializationGenerator.CreateSerializationMethod(ISerializationBase serializationFormat)
at Hyak.JsonSerializationGenerator.SerializeJsonRequest[T](StatementsBuilder`1 builder, IJsonBase root)
at Hyak.JsonSerializationFramework.Serialize[T](ISerializationBase serialization, StatementsBuilder`1& builder)
at Hyak.CodeGeneratorExtensions.SerializationExtensions`1.Serialize(IDictionary`2 requestBodyDefinitions, Type& requestType)
at Hyak.ClientGenerator.<>c__DisplayClass3a`1.<SerializeRequest>b__37()
at Hyak.Ensure.ErrorContext(Action action, String context)
Exception: There was an error during code generation when trying to add a client for the Microsoft Azure API App
Generating client code and adding to project failed
Adding client for Microsoft Azure API App failed
我想我在我的模型中使用了生成器不支持的东西。我能以某种方式获得更详细的错误消息来解释问题所在吗?