Springdoc GroupedOpenApi not following global parameters set with OperationCustomizer

前端 未结 1 1752
礼貌的吻别
礼貌的吻别 2021-01-17 04:06

When using GroupedOpenApi to define an API group, the common set of parameters that are added to every endpoint is not present in the parameters list. Below are

相关标签:
1条回答
  • 2021-01-17 04:40

    Attach the required OperationCustomizerobject while building the Api Group.

    @Bean
    public GroupedOpenApi v1Apis(GlobalHeaderAdder globalHeaderAdder) {
        return GroupedOpenApi.builder().group("v1 APIs")
                // hide all v2 APIs
                .pathsToExclude("/api/v2/**", "/v2/**")
                // show all v1 APIs
                .pathsToMatch("/api/v1/**", "/v1/**")
                .addOperationCustomizer(globalHeaderAdded) 
                .build();
    }
    

    Edit: Answer updated with reference to @Value not providing values from application properties Spring Boot

    0 讨论(0)
提交回复
热议问题