Swagger Dubbo makes Dubbo Service show as Swagger RESTful API, which makes it easy to document and test.
- Add Swagger Dependency
- Add Dubbo Denpendency
- Add Swagger-Dubbo Denpendency:
<dependency>
<groupId>cn.gengar</groupId>
<artifactId>swagger-dubbo</artifactId>
<version>0.0.1-beta</version>
</dependency>
@EnableSwagger2
@EnableSwaggerDubbo
@Configuration
public class SwaggerDubboConfig
{
@Bean
public Docket dubboDocket(){
return new Docket(DocumentationType.SWAGGER_2)
.groupName("dubbo")
.select()
.apis(DubboRequestHandlerSelectors.any()) //get dubbo api only
.paths(PathSelectors.any())
.build();
}
}
Copyright [2018] [Gengar Yu]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.