简体   繁体   English

如何从https://github.com/microsoftgraph/MSGraph-SDK-Code-Generator转到代码(java)

[英]How to go from https://github.com/microsoftgraph/MSGraph-SDK-Code-Generator to code (java)

I am trying to make changes to the java templates and build the java code based on that template. 我试图对Java模板进行更改,并基于该模板构建Java代码。

  1. built the typewriter solution in vs2017 在vs2017中构建了打字机解决方案
  2. cloned https://github.com/microsoftgraph/microsoft-graph-docs 克隆的https://github.com/microsoftgraph/microsoft-graph-docs
  3. locally saved the content of https://graph.microsoft.com/v1.0/ $metadata (instructions around using typewriter are not so great, it says the above is the default yet it also says that it's a required value for the -m switch, so which one is it, does it have a default value or is it required) 在本地保存https://graph.microsoft.com/v1.0/ $ metadata的内容(有关使用打字机的说明不是很好,它说上面是默认值,但它也说这是-的必需值- m开关,是哪个开关,它是否具有默认值或是必需的)
  4. ran from Release .\\typewriter.exe -v Info -m C:\\Users\\Administrator\\source\\repos\\v1.0.12.28.2018.xml -o output -l Java -d C:\\Users\\Administrator\\source\\repos\\microsoft-graph-docs -g Full 从Release .\\typewriter.exe -v Info -m C:\\Users\\Administrator\\source\\repos\\v1.0.12.28.2018.xml -o output -l Java -d C:\\Users\\Administrator\\source\\repos\\microsoft-graph-docs -g Full

C:\Users\Administrator\source\repos\MSGraph-SDK-Code-Generator\src\Typewriter\bin\Release>.\typewriter.exe -v Info -m C:\Users\Administrator\source\repos\v1.0.12.28.2018.xml -o output -l Java -d C:\Users\Administrator\source\repos\microsoft-graph-docs -g Full
12:02:43 MetadataResolver Loading metadata from C:\Users\Administrator\source\repos\v1.0.12.28.2018.xml.
12:02:43 MetadataPreprocessor RemoveCapabilityAnnotations rule was applied so that capability annotations are removed from the metadata.
12:02:43 MetadataPreprocessor AddLongDescriptionToThumbnail rule was applied to the thumbnail complex type.
12:02:43 MetadataPreprocessor RemoveHasStream rule was applied so that we removed the HasStream attribute from the onenotePage entityType.
12:02:43 MetadataPreprocessor RemoveHasStream rule was applied so that we removed the HasStream attribute from the onenoteResource entityType.
12:02:43 MetadataPreprocessor AddContainsTarget rule applied so that ContainsTarget=true was set on the plannerPlan entity's buckets navigation property.
12:02:43 MetadataPreprocessor AddContainsTarget rule applied so that ContainsTarget=true was set on the plannerUser entity's tasks navigation property.
12:02:43 MetadataPreprocessor AddContainsTarget rule applied so that ContainsTarget=true was set on the plannerPlan entity's tasks navigation property.
12:02:43 MetadataPreprocessor AddContainsTarget rule applied so that ContainsTarget=true was set on the plannerBucket entity's tasks navigation property.
12:02:43 MetadataPreprocessor AddContainsTarget rule applied so that ContainsTarget=true was set on the plannerGroup entity's plans navigation property.
12:02:43 MetadataPreprocessor AddContainsTarget rule applied so that ContainsTarget=true was set on the plannerUser entity's plans navigation property.
12:02:43 MetadataPreprocessor AddContainsTarget rule was not applied. No entity type named plannerDelta found with missing navigation property containment.
12:02:43 FileWriter Metadata written to C:\Users\Administrator\source\repos\MSGraph-SDK-Code-Generator\src\Typewriter\bin\Release\cleanMetadata.xml
12:02:43 AnnotationHelper Opening documentation from C:\Users\Administrator\source\repos\microsoft-graph-docs
Using API requirements file: C:\Users\Administrator\source\repos\microsoft-graph-docs\api-reference\v1.0\config\oneapi-design-v1.json
Using schema config file: C:\Users\Administrator\source\repos\microsoft-graph-docs\api-reference\v1.0\config\schema-config.json
Using table definitions from: C:\Users\Administrator\source\repos\microsoft-graph-docs\api-reference\v1.0\config\table-header-config.json
12:02:43 AnnotationHelper Parsing documentation files

Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at ApiDoctor.Validation.ExtensionMethods.ParseParameterDataType(String value, Boolean isCollection, Action`1 addErrorAction, ParameterDataType defaultValue)
   at ApiDoctor.Validation.TableSpec.TableSpecConverter.<>c__DisplayClass6_0.<ParseParameterTable>b__0(String[] r)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at ApiDoctor.Validation.TableSpec.TableSpecConverter.ParseParameterTable(IMarkdownTable table, ParameterLocation location, TableDecoder decoder, IssueLogger issues, Boolean navigationProperties)
   at ApiDoctor.Validation.TableSpec.TableSpecConverter.ParseTableSpec(Block tableSpecBlock, Stack`1 headerStack, IssueLogger issues)
   at ApiDoctor.Validation.DocFile.ParseMarkdownBlocks(IssueLogger issues)
   at ApiDoctor.Validation.DocFile.Scan(String tags, IssueLogger issues)
   at ApiDoctor.Validation.DocSet.ScanDocumentation(String tags, IssueLogger issues)
   at Typewriter.AnnotationHelper.GetDocSet(Options options, IssueLogger issues) in C:\Users\Administrator\source\repos\MSGraph-SDK-Code-Generator\src\Typewriter\DocAnnotationWriter.cs:line 128
   at Typewriter.AnnotationHelper.<ApplyAnnotationsToCsdl>d__2.MoveNext() in C:\Users\Administrator\source\repos\MSGraph-SDK-Code-Generator\src\Typewriter\DocAnnotationWriter.cs:line 88
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Typewriter.Generator.CleanMetadata(String csdlContents, Options options) in C:\Users\Administrator\source\repos\MSGraph-SDK-Code-Generator\src\Typewriter\Generator.cs:line 53
   at Typewriter.Program.GenerateSDK(Options options) in C:\Users\Administrator\source\repos\MSGraph-SDK-Code-Generator\src\Typewriter\Program.cs:line 44
   at Typewriter.Program.<>c.<Main>b__2_0(Options opts) in C:\Users\Administrator\source\repos\MSGraph-SDK-Code-Generator\src\Typewriter\Program.cs:line 21
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at Typewriter.Program.Main(String[] args) in C:\Users\Administrator\source\repos\MSGraph-SDK-Code-Generator\src\Typewriter\Program.cs:line 20

C:\Users\Administrator\source\repos\MSGraph-SDK-Code-Generator\src\Typewriter\bin\Release>

I am able to reproduce your issue and you are getting this error as the ApiDoctor.Validation package is not installed in your solution. 我能够重现您的问题,并且您的解决方案中未安装ApiDoctor.Validation软件包,因此您会收到此错误。
在此处输入图片说明

Please install this package from Nuget Manager and try executing your code. 请从Nuget Manager安装此软件包,然后尝试执行您的代码。 Once installed I am able to run the typewriter.exe without any issues. 安装完成后,我可以运行typewriter.exe,而不会出现任何问题。 在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在阅读 Github.com 处的代码时导航到另一种方法或 class - How to navigate to another method or class while reading code at Github.com Jenkins-无法读取“ https://github.com”的用户名:没有这样的设备或地址 - Jenkins - could not read Username for 'https://github.com': No such device or address 当我从 github https://github.com/smarteist/android-image-slider 使用这个库时,无法解析符号“动画” - cannot resolve symbol 'Animations' when i use this library from github https://github.com/smarteist/android-image-slider XSLT的Java代码生成器 - Java code generator from XSLT 如何在 eclipse exp 项目上运行 gradle 项目:https://github.com/nkzawa/socket.io-android-chat - How to run a gradle project on eclipse exp project: https://github.com/nkzawa/socket.io-android-chat 如何从打击Java代码生成Go代码? - How to generate Go code from blow Java code? 如何使用msgraph-sdk-java将成员添加到目录角色 - How to add a member to a directory role using the msgraph-sdk-java 无法获取“https://fyber.bintray.com/maven/com/fyber/fairbid-sdk/3.0.1/fairbid-sdk-3.0.1.aar”。 从服务器收到状态代码 403:禁止 - Could not GET 'https://fyber.bintray.com/maven/com/fyber/fairbid-sdk/3.0.1/fairbid-sdk-3.0.1.aar'. Received status code 403 from server: Forbidden 尝试构建FBReaderJ时出现BUILD FAILED错误(https://github.com/geometer/FBReaderJ) - BUILD FAILED error while trying to build FBReaderJ(https://github.com/geometer/FBReaderJ) 需要 WebLogic 导出器“https://github.com/oracle/weblogic-monitoring-exporter#Configuration”的 jar - Need jar for WebLogic exporter "https://github.com/oracle/weblogic-monitoring-exporter#Configuration"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM