简体   繁体   中英

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

Configurations ==>

  • OpenAPI version : 3.0.0
  • Swagger-parser 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 .

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 ==>

  1. Resolving nested schemas that might be referenced from "#components/schemas/"
  2. Resolving requestBody referenced from "#components/requestBodies/"
  3. Resolving response referenced from "#components/responses/"
  4. Resolving callback referenced from "#components/callbacks/"
  5. Combination of point 2,1
  6. Combination of point 3,1
  7. Combination of point 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 .

Actually, the Callbacks PathItem related members were not getting resolved using the resolveFully ParseOptions that we set as shown in code snippet.

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.

Hopefully, it should be a part of the 2.0.28 release.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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