简体   繁体   English

resolveFully 不解析与回调相关的 PathItem 的嵌套引用或正常引用

[英]resolveFully doesn't resolve nested references or normal references for Callbacks related PathItem

Configurations ==>配置==>

  • OpenAPI version : 3.0.0 OpenAPI 版本:3.0.0
  • Swagger-parser 2.0.26 Swagger 解析器 2.0.26

Issue ==> I am using the resolveFully parse option as mentioned in the documentation but seems its not working for most of my usecases which involve callbacks and path item for callbacks .问题==> 我正在使用文档中提到的resolveFully解析选项,但似乎它不适用于我的大多数用例,这些用例涉及回调和回调路径项

ParseOptions parseOptions = new ParseOptions();
parseOptions.setResolve(true);
parseOptions.setResolveFully(true);
OpenAPI result = new OpenAPIV3Parser().read("Swagger.json", null, parseOptions);

My use-cases for Callbacks related PathItem are like below ==>我的回调相关 PathItem 用例如下所示==>

  1. Resolving nested schemas that might be referenced from "#components/schemas/"解析可能从“#components/schemas/”引用的嵌套模式
  2. Resolving requestBody referenced from "#components/requestBodies/"解析从“#components/requestBodies/”引用的 requestBody
  3. Resolving response referenced from "#components/responses/"解析从“#components/responses/”引用的响应
  4. Resolving callback referenced from "#components/callbacks/"解析从“#components/callbacks/”引用的回调
  5. Combination of point 2,1点 2,1 的组合
  6. Combination of point 3,1点 3,1 的组合
  7. Combination of point 4,3,21 4、3、21点的组合

Looks like an issue.看起来是个问题。 Technically it should resolve the local references and place it as the inline definitions in the OpenAPI document java object, if I am not mistaken reading the mentioned here .从技术上讲,它应该解析本地引用并将其作为 OpenAPI 文档 java 对象中的内联定义,如果我没有错误地阅读这里提到的内容。

Actually, the Callbacks PathItem related members were not getting resolved using the resolveFully ParseOptions that we set as shown in code snippet.实际上,使用我们在代码片段中设置的 resolveFully ParseOptions 并没有解决与 Callbacks PathItem 相关的成员。

Please refer to this PR for the same issue raised by me on the SwaggerParser project and now its closed as the PR was merged to master.有关我在 SwaggerParser 项目中提出的相同问题,请参阅PR,现在它已关闭,因为 PR 已合并到 master。

Hopefully, it should be a part of the 2.0.28 release.希望它应该是 2.0.28 版本的一部分。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM