我添加swagger-ui到我的 spring-boot 服务应用程序中,在访问链接时遇到了一些类似的错误/swagger-ui/。
我在招摇中的参考来自这里:
https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api
这是我的配置示例代码:
@Configuration
public class WebConfiguration implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new LoggerInterceptor());
}
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试排除这部分:
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
}
Run Code Online (Sandbox Code Playgroud)
仍然没有决心。希望有人可以帮忙。谢谢。
我有twitter数据。这些数据中有一些nested对象。我想将这些字段收集到Java. 我正在使用@SerializedName注释将一些嵌套字段导入到我的 java 对象中。
我的示例 json 如下所示:
{
"created_at": "Sat Jun 15 19:21:29 +0000 2019",
"text": "RT @BuzzTechy: [BEST] Udemy Course - Create a Python Powered Chatbot in Under 60 Minutes \n\nhttps:\/\/t.co\/jMIW38FmmZ \n\n#AI #Python #Chatbot\u2026",
"source": "\u003ca href=\"https:\/\/allentowngroup.com\" rel=\"nofollow\"\u003ebobbidigi\u003c\/a\u003e",
"truncated": false,
"in_reply_to_screen_name": "asdsf"
"user": {
"id": 1724601306,
"name": "Rob's Coding News In The Hood"
}
}
Run Code Online (Sandbox Code Playgroud)
和我的java对象:
public class TweetEntity implements Serializable {
private static long serialVersionUID = 1L;
@SerializedName("created_at")
private Date …Run Code Online (Sandbox Code Playgroud)