io.swagger.v3.oas.annotations.servers.Server Java Examples

The following examples show how to use io.swagger.v3.oas.annotations.servers.Server. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ServersService.java    From lagom-openapi with Apache License 2.0 6 votes vote down vote up
@Operation(
    responses = {
        @ApiResponse(
            responseCode = "201",
            description = "Null response"
        )
    },
    servers = {
        @Server(
            description = "operation server 1",
            url = "http://op1",
            variables = {
                @ServerVariable(name = "var1", description = "var 1", defaultValue = "1", allowableValues = {"1", "2"})
            })
    })
@Server(
    description = "method server 1",
    url = "http://method1",
    variables = {
        @ServerVariable(name = "var1", description = "var 1", defaultValue = "1", allowableValues = {"1", "2"})
    })
@Server(
    description = "method server 2",
    url = "http://method2"
)
ServiceCall<NotUsed, NotUsed> test();
 
Example #2
Source File: Reader.java    From proteus with Apache License 2.0 5 votes vote down vote up
public Operation parseMethod(
								Method method,
								List<Parameter> globalParameters,
								Produces methodProduces,
								Produces classProduces,
								Consumes methodConsumes,
								Consumes classConsumes,
								List<SecurityRequirement> classSecurityRequirements,
								Optional<io.swagger.v3.oas.models.ExternalDocumentation> classExternalDocs,
								Set<String> classTags,
								List<io.swagger.v3.oas.models.servers.Server> classServers,
								boolean isSubresource,
								RequestBody parentRequestBody,
								ApiResponses parentResponses,
								JsonView jsonViewAnnotation,
								io.swagger.v3.oas.annotations.responses.ApiResponse[] classResponses)
{
	JavaType classType = TypeFactory.defaultInstance().constructType(method.getDeclaringClass());
	return parseMethod(
						classType.getClass(),
						method,
						globalParameters,
						methodProduces,
						classProduces,
						methodConsumes,
						classConsumes,
						classSecurityRequirements,
						classExternalDocs,
						classTags,
						classServers,
						isSubresource,
						parentRequestBody,
						parentResponses,
						jsonViewAnnotation,
						classResponses);
}