Skip to content

global-operation-parameters在不配置的情况下会出现空指针异常 #225

Description

@eureka-lyq

如题,在DocketConfiguration中创建createSpringFoxRestApi的时候,如果没有设置global-operation-parameters,下面的代码会报空指针
private List getRequestParameters(List<SwaggerProperties.GlobalOperationParameter> properties) {
return properties.stream()
.map(param -> new RequestParameterBuilder().name(param.getName()).description(param.getDescription())
.in(ParameterType.from(param.getParameterType())).required(param.getRequired())
.query(q -> q.defaultValue(param.getType()))
.query(q -> q.model(m -> m.scalarModel(!ScalarType.from(param.getType(), param.getFormat()).isPresent()
? ScalarType.STRING : ScalarType.from(param.getType(), param.getFormat()).get())))
.build())
.collect(Collectors.toList());
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions