小编Deb*_*Roy的帖子

与终端 pty 主机进程的连接无响应

安装 VSCode 后,我开始收到这个特定的通知:

与终端 pty 主机进程的连接无响应,终端可能停止工作。

截屏

在我单击重新启动按钮之前,通知不会消失。但是,尽管单击此按钮,但没有发生任何变化,并且几秒钟后再次弹出通知。

这个问题导致我的终端停止工作并且无法运行节点应用程序。

pty visual-studio-code

24
推荐指数
4
解决办法
2万
查看次数

Springdoc GroupedOpenApi 不遵循使用 OperationCustomizer 设置的全局参数

用于GroupedOpenApi定义 API 组时,添加到每个端点的通用参数集不存在于参数列表中。下面是各自的代码

@Bean
public GroupedOpenApi v1Apis() {
    return GroupedOpenApi.builder().group("v1 APIs")
            // hide all v2 APIs
            .pathsToExclude("/api/v2/**", "/v2/**")
            // show all v1 APIs
            .pathsToMatch("/api/v1/**", "/v1/**")
            .build();
}
Run Code Online (Sandbox Code Playgroud)

以及将标准标头添加到所有端点的类

@Component
public class GlobalHeaderAdder implements OperationCustomizer {
    @Override
    public Operation customize(Operation operation, HandlerMethod handlerMethod) {
        operation.addParametersItem(new Parameter().$ref("#/components/parameters/ClientID"));
        operation.addSecurityItem(new SecurityRequirement().addList("Authorization"));
        List<Parameter> parameterList = operation.getParameters();
        if (parameterList!=null && !parameterList.isEmpty()) {
            Collections.rotate(parameterList, 1);
        }
        return operation;
    }
}
Run Code Online (Sandbox Code Playgroud)

实际产量

实际产量

预期输出

预期输出

解决方法

添加要在应用程序属性文件中包含/排除的路径可以解决该错误。但代码级别的一些东西将非常感激。

spring-boot springdoc springdoc-openapi-ui

7
推荐指数
1
解决办法
8686
查看次数

如何在 Springdoc Swagger v3 中表示字符串列表?

下面是与我的情况类似的代码

@ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "OK", content = {@Content(schema = @Schema(
                implementation =  // <-- What to specify here?
            ))})
})
@GetMapping(value = "/user")
public ResponseEntity<List<User>> getUsers() {
    return ResponseEntity.ok().body(Arrays.asList(new User(), new User()));
}
Run Code Online (Sandbox Code Playgroud)

如何指定从端点返回的用户列表ApiResponse()

请注意,Open-API-Definition 不是项目的一部分,而是在另一个项目中指定的。

swagger-3.0 springdoc

7
推荐指数
1
解决办法
5213
查看次数

绘制一条始终与其父 BoxElement 一样宽的线?

我正在使用BoxElement来自祝福的显示聊天记录。

使用 来添加句子pushLine。为清楚起见,天数按行划分(使用 添加的另一个字符串pushLine)。每行与父行一样宽BoxElement

但是,如果调整 TUI 的大小,则该线不再适合。

我有两个问题:

  1. 那条线如何适应它的新宽度?
  2. (加分)如何将文本居中放置在该行的中间?

该问题的示例如下所示:

/**
 * Example.ts
 */
import * as blessed from 'blessed';

const screen = blessed.screen({
    smartCSR: true,
    title: 'Chatr',
    dockBorders: true
});

const chatBox = blessed.box({
    parent: screen,
    title: 'Chatbox',
    top: 'top',
    left: 'center',
    height: '100%',
    width: '100%',
    border: {
        type: 'line'
    },
});
screen.append(chatBox);
screen.render();

chatBox.pushLine("This is the first line");

 // This is the separator - and will not …
Run Code Online (Sandbox Code Playgroud)

javascript tui node.js blessed

7
推荐指数
1
解决办法
200
查看次数

如何注释 DTO 以使其显示在 SwaggerUI 架构中?

我有一个带有@RequestBodyDTO 的控制器。我需要显示 DTO 的架构,而不是stringSwagger 中 RequestBody 架构中的默认架构。

通过在 API 之上使用 @Operation 并在其中使用 @Parameter,我已经能够在两个地方描述 DTO

图片描述

并填写示例(参见代码)。我已经尝试@Schema@Operation(在 requestBody 下)和@Parameter注释。前者抛出 NPE,后者不做任何改变,并针对 DTO 本身中的对应注释进行了各种尝试。

样品控制器

@RequestMapping(value = "/{myPathVar}", method = RequestMethod.POST)
@Operation(summary = "Create something.", 
    parameters = { @Parameter(in = ParameterIn.PATH, name = "myPathVar", description = "Some path variable. Swagger uses this description.") },             
    requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
        description = "My description here.", 
        content = @Content(examples = @ExampleObject("{\"A\" : \"a\",\"B\" : \"{\"b\" : \"foo\", \"bb\" …
Run Code Online (Sandbox Code Playgroud)

swagger spring-boot springdoc springdoc-openapi-ui

5
推荐指数
1
解决办法
2万
查看次数