本文整理了Java中io.swagger.v3.oas.models.OpenAPI.path()
方法的一些代码示例,展示了OpenAPI.path()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OpenAPI.path()
方法的具体详情如下:
包路径:io.swagger.v3.oas.models.OpenAPI
类名称:OpenAPI
方法名:path
暂无
代码示例来源:origin: swagger-api/swagger-core
@Test
public void testSerializeASpecWithPathReferences() throws Exception {
OpenAPI swagger = new OpenAPI()
.addServersItem(new Server().url("http://petstore.swagger.io"));
PathItem expectedPath = new PathItem().$ref("http://my.company.com/paths/health.json");
swagger.path("/health", expectedPath);
String swaggerJson = Json.mapper().writeValueAsString(swagger);
OpenAPI rebuilt = Json.mapper().readValue(swaggerJson, OpenAPI.class);
final PathItem path = rebuilt.getPaths().get("/health");
assertEquals(path, expectedPath);
}
代码示例来源:origin: swagger-api/swagger-core
@Test
public void testSerializeASpecWithResponseReferences() throws Exception {
OpenAPI swagger = new OpenAPI()
.addServersItem(new Server().url("http://petstore.swagger.io"));
ApiResponse expectedResponse = new ApiResponse().$ref("http://my.company.com/paths/health.json");
PathItem expectedPath = new PathItem()
.get(
new Operation().responses(
new ApiResponses()
.addApiResponse("200", expectedResponse)));
swagger.path("/health", expectedPath);
String swaggerJson = Json.mapper().writeValueAsString(swagger);
OpenAPI rebuilt = Json.mapper().readValue(swaggerJson, OpenAPI.class);
assertEquals(rebuilt.getPaths().get("/health").getGet().getResponses().get("200"), expectedResponse);
}
}
代码示例来源:origin: swagger-api/swagger-core
.path("/pets", new PathItem().get(get));
代码示例来源:origin: swagger-api/swagger-core
.addList("api_key"));
oas.path("/pets", new PathItem().get(get));
代码示例来源:origin: io.swagger.parser.v3/swagger-parser-v3
updateLocalRefs(resolvedPath, pathRef);
openAPI.path(pathStr, resolvedPath);
pathItem = resolvedPath;
代码示例来源:origin: swagger-api/swagger-parser
updateLocalRefs(resolvedPath, pathRef);
openAPI.path(pathStr, resolvedPath);
pathItem = resolvedPath;
代码示例来源:origin: org.openapitools.swagger.parser/swagger-parser-v3
updateLocalRefs(resolvedPath, pathRef);
openAPI.path(pathStr, resolvedPath);
pathItem = resolvedPath;
内容来源于网络,如有侵权,请联系作者删除!