io.swagger.v3.oas.annotations.media.Schema Java Examples

The following examples show how to use io.swagger.v3.oas.annotations.media.Schema. 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: EnvironmentEndpoint.java    From pnc with Apache License 2.0 7 votes vote down vote up
/**
 * {@value GET_SPECIFIC_DESC}
 * 
 * @param id {@value E_ID}
 * @return
 */
@Operation(
        summary = GET_SPECIFIC_DESC,
        responses = {
                @ApiResponse(
                        responseCode = SUCCESS_CODE,
                        description = SUCCESS_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = Environment.class))),
                @ApiResponse(responseCode = NOT_FOUND_CODE, description = NOT_FOUND_DESCRIPTION),
                @ApiResponse(
                        responseCode = SERVER_ERROR_CODE,
                        description = SERVER_ERROR_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@GET
@Path("/{id}")
Environment getSpecific(@Parameter(description = E_ID) @PathParam("id") String id);
 
Example #2
Source File: Sample.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Produces({ MediaType.APPLICATION_JSON })
@Path("/{name}")
@GET
@Operation(
    summary = "Get item by name",
    description = "Get operation with type and headers",
    responses = {
        @ApiResponse(content = @Content(schema = @Schema(implementation = Item.class)), responseCode = "200"),
        @ApiResponse(responseCode = "404")
    }
)
public Response getItem(
        @Parameter(required = true) @HeaderParam("Accept-Language") final String language,
        @Parameter(required = true) @PathParam("name") String name) {
    return items.containsKey(name) 
        ? Response.ok().entity(items.get(name)).build() 
            : Response.status(Status.NOT_FOUND).build();
}
 
Example #3
Source File: UserEndpoint.java    From pnc with Apache License 2.0 6 votes vote down vote up
/**
 * {@value GET_BUILDS}
 * 
 * @param id {@value U_ID}
 * @param pageParameters
 * @param buildsFilter
 * @return
 */
@Operation(
        summary = GET_BUILDS,
        responses = {
                @ApiResponse(
                        responseCode = SUCCESS_CODE,
                        description = SUCCESS_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = BuildPage.class))),
                @ApiResponse(
                        responseCode = INVALID_CODE,
                        description = INVALID_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
                @ApiResponse(
                        responseCode = SERVER_ERROR_CODE,
                        description = SERVER_ERROR_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@GET
@Path("/{id}/builds")
Page<Build> getBuilds(
        @Parameter(description = U_ID) @PathParam("id") String id,
        @Valid @BeanParam PageParameters pageParameters,
        @BeanParam BuildsFilterParameters buildsFilter);
 
Example #4
Source File: BuildEndpoint.java    From pnc with Apache License 2.0 6 votes vote down vote up
/**
 * {@value GET_SPECIFIS_DESC}
 *
 * @param id {@value B_ID}
 * @return
 */
@Operation(
        summary = GET_SPECIFIS_DESC,
        responses = {
                @ApiResponse(
                        responseCode = SUCCESS_CODE,
                        description = SUCCESS_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = Build.class))),
                @ApiResponse(responseCode = NOT_FOUND_CODE, description = NOT_FOUND_DESCRIPTION),
                @ApiResponse(
                        responseCode = SERVER_ERROR_CODE,
                        description = SERVER_ERROR_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@GET
@Path("/{id}")
Build getSpecific(@Parameter(description = B_ID) @PathParam("id") String id);
 
Example #5
Source File: Sample.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Produces({ MediaType.APPLICATION_JSON })
@Path("/{name}")
@PUT
@Operation(
    summary = "Update an existing new item",
    description = "Put operation with form parameter",
    responses = {
        @ApiResponse(
            content = @Content(schema = @Schema(implementation = Item.class)),
            responseCode = "200"
        )
    }
)
public Item updateItem(
        @Parameter(required = true) @PathParam("name") String name,
        @Parameter(required = true) @FormParam("value") String value) {
    Item item = new Item(name, value);
    items.put(name,  item);
    return item;
}
 
Example #6
Source File: ProductMilestoneEndpoint.java    From pnc with Apache License 2.0 6 votes vote down vote up
/**
 * {@value VALIDATE_VERSION}
 * 
 * @param productMilestone
 * @return
 */
@Operation(
        summary = VALIDATE_VERSION,
        responses = {
                @ApiResponse(
                        responseCode = SUCCESS_CODE,
                        description = SUCCESS_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ValidationResponse.class))),
                @ApiResponse(
                        responseCode = INVALID_CODE,
                        description = INVALID_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
                @ApiResponse(
                        responseCode = SERVER_ERROR_CODE,
                        description = SERVER_ERROR_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@POST
@Path("/validate-version")
ValidationResponse validateVersion(@Valid VersionValidationRequest productMilestone);
 
Example #7
Source File: MostRecentEntryProxyResource.java    From browserup-proxy with Apache License 2.0 5 votes vote down vote up
@GET
@Path("/assertResponseHeaderMatches")
@Produces(MediaType.APPLICATION_JSON)
@Operation(description = "Assert that if the most recent response found by url pattern has header with name " +
        "found by name pattern - it's value should match value pattern.",
        responses = {@ApiResponse(
                description = "Assertion result",
                content = @Content(
                        mediaType = MediaType.APPLICATION_JSON,
                        schema = @Schema(implementation = AssertionResult.class)))})
public AssertionResult responseHeaderMatches(
        @PathParam(PORT)
        @NotNullConstraint(paramName = PORT)
        @PortWithExistingProxyConstraint
        @Parameter(required = true, in = ParameterIn.PATH, description = PORT_DESCRIPTION) int port,

        @QueryParam(URL_PATTERN)
        @NotBlankConstraint(paramName = URL_PATTERN)
        @PatternConstraint(paramName = URL_PATTERN)
        @Parameter(required = true, description = URL_PATTERN_DESCRIPTION) String urlPattern,

        @QueryParam(HEADER_NAME_PATTERN)
        @PatternConstraint(paramName = HEADER_NAME_PATTERN)
        @Parameter(required = true, description = HEADER_NAME_PATTERN_DESCRIPTION) String headerNamePattern,

        @QueryParam(HEADER_VALUE_PATTERN)
        @NotBlankConstraint(paramName = HEADER_VALUE_PATTERN)
        @PatternConstraint(paramName = HEADER_VALUE_PATTERN)
        @Parameter(required = true, description = HEADER_VALUE_PATTERN_DESCRIPTION) String headerValuePattern) {

    return proxyManager.get(port).assertMostRecentResponseHeaderMatches(
            Pattern.compile(urlPattern),
            headerNamePattern != null ? Pattern.compile(headerNamePattern) : null,
            Pattern.compile(headerValuePattern));
}
 
Example #8
Source File: RoleService.java    From syncope with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new role.
 *
 * @param roleTO role to be created
 * @return Response object featuring Location header of created role
 */
@ApiResponses(
        @ApiResponse(responseCode = "201",
                description = "Role successfully created", headers = {
            @Header(name = RESTHeaders.RESOURCE_KEY, schema =
                    @Schema(type = "string"),
                    description = "Key value for the entity created"),
            @Header(name = HttpHeaders.LOCATION, schema =
                    @Schema(type = "string"),
                    description = "URL of the entity created") }))
@POST
@Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
Response create(@NotNull RoleTO roleTO);
 
Example #9
Source File: SingularityRunNowRequest.java    From Singularity with Apache License 2.0 5 votes vote down vote up
@Schema(
  description = "Override the resources from the active deploy for this run",
  nullable = true
)
public Optional<Resources> getResources() {
  return resources;
}
 
Example #10
Source File: RoleService.java    From syncope with Apache License 2.0 5 votes vote down vote up
/**
 * Updates the role matching the provided key.
 *
 * @param roleTO role to be stored
 */
@Parameter(name = "key", description = "Role's key", in = ParameterIn.PATH, schema =
        @Schema(type = "string"))
@ApiResponses(
        @ApiResponse(responseCode = "204", description = "Operation was successful"))
@PUT
@Path("{key}")
@Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
void update(@NotNull RoleTO roleTO);
 
Example #11
Source File: SingularityRequestParent.java    From Singularity with Apache License 2.0 5 votes vote down vote up
@Schema(
  description = "Settings for the active deploy, may not contain the full deploy json",
  nullable = true
)
public Optional<SingularityDeploy> getActiveDeploy() {
  return activeDeploy;
}
 
Example #12
Source File: Validating.java    From syndesis with Apache License 2.0 5 votes vote down vote up
@POST
@Path(value = "/validation")
@Consumes("application/json")
@Produces(MediaType.APPLICATION_JSON)
@ApiResponse(responseCode = "204", description = "All validations pass")
@ApiResponse(responseCode = "400", description = "Found violations in validation", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Violation.class))))
default Response validate(@NotNull final T obj) {
    final Set<ConstraintViolation<T>> constraintViolations = getValidator().validate(obj, AllValidations.class);

    if (constraintViolations.isEmpty()) {
        return Response.noContent().build();
    }

    throw new ConstraintViolationException(constraintViolations);
}
 
Example #13
Source File: SingularityMesosArtifact.java    From Singularity with Apache License 2.0 5 votes vote down vote up
@Schema(
  description = "If true, chmod the download file so it is executable",
  defaultValue = "false"
)
public boolean isExecutable() {
  return executable;
}
 
Example #14
Source File: SingularityDeployMarker.java    From Singularity with Apache License 2.0 5 votes vote down vote up
@Schema(
  description = "An optional message associated with this deploy",
  nullable = true
)
public Optional<String> getMessage() {
  return message;
}
 
Example #15
Source File: LogControllerMapping.java    From sdk with Apache License 2.0 4 votes vote down vote up
/**
 *  Enum options - METRICS_MGR_PORT_0, METRICS_MGR_PORT_1, METRICS_MGR_PORT_2, METRICS_MGR_PORT_3.
 * @return metricsMgrPort
**/
@Schema(description = " Enum options - METRICS_MGR_PORT_0, METRICS_MGR_PORT_1, METRICS_MGR_PORT_2, METRICS_MGR_PORT_3.")
public String getMetricsMgrPort() {
  return metricsMgrPort;
}
 
Example #16
Source File: SingularityTaskMetadata.java    From Singularity with Apache License 2.0 4 votes vote down vote up
@Schema(description = "Timestamp this metadata was created")
public long getTimestamp() {
  return timestamp;
}
 
Example #17
Source File: SingularityTaskHealthcheckResult.java    From Singularity with Apache License 2.0 4 votes vote down vote up
@Schema(description = "Status code if a response was received", nullable = true)
public Optional<Integer> getStatusCode() {
  return statusCode;
}
 
Example #18
Source File: HelloController.java    From springdoc-openapi with Apache License 2.0 4 votes vote down vote up
@GetMapping("/example")
public void test(@Parameter(schema = @Schema(hidden = true)) JsonNode json) {
}
 
Example #19
Source File: SeRuntimeProperties.java    From sdk with Apache License 2.0 4 votes vote down vote up
/**
 * Deprecated. Field deprecated in 17.2.5. Field introduced in 17.2.1.
 * @return disableGro
**/
@Schema(description = "Deprecated. Field deprecated in 17.2.5. Field introduced in 17.2.1.")
public Boolean isDisableGro() {
  return disableGro;
}
 
Example #20
Source File: ALBServicesConfig.java    From sdk with Apache License 2.0 4 votes vote down vote up
/**
 * Time interval in minutes. Allowed values are 5-60. Field introduced in 18.2.6.
 * @return pollingInterval
**/
@Schema(description = "Time interval in minutes. Allowed values are 5-60. Field introduced in 18.2.6.")
public Integer getPollingInterval() {
  return pollingInterval;
}
 
Example #21
Source File: RegisterSiteParams.java    From oxd with Apache License 2.0 4 votes vote down vote up
/**
 * specifies custom attribute map copy.
 * @return customAttributes
**/
@Schema(description = "specifies custom attribute map copy.")
public Map<String, String> getCustomAttributes() {
  return customAttributes;
}
 
Example #22
Source File: SingularityDisasterDataPoint.java    From Singularity with Apache License 2.0 4 votes vote down vote up
@Schema(description = "A count of active tasks")
public int getNumActiveTasks() {
  return numActiveTasks;
}
 
Example #23
Source File: TestSeDatastoreLevel1.java    From sdk with Apache License 2.0 4 votes vote down vote up
/**
 * Unique object identifier of the object.
 * @return uuid
**/
@Schema(description = "Unique object identifier of the object.")
public String getUuid() {
  return uuid;
}
 
Example #24
Source File: Cloud.java    From sdk with Apache License 2.0 4 votes vote down vote up
/**
 * Custom tags for all Avi created resources in the cloud infrastructure. Field introduced in 17.1.5.
 * @return customTags
**/
@Schema(description = "Custom tags for all Avi created resources in the cloud infrastructure. Field introduced in 17.1.5.")
public List<CustomTag> getCustomTags() {
  return customTags;
}
 
Example #25
Source File: VIMgrVcenterRuntime.java    From sdk with Apache License 2.0 4 votes vote down vote up
/**
 *  It is a reference to an object of type VIMgrDCRuntime.
 * @return datacenterRefs
**/
@Schema(description = " It is a reference to an object of type VIMgrDCRuntime.")
public List<String> getDatacenterRefs() {
  return datacenterRefs;
}
 
Example #26
Source File: HSMThalesNetHsm.java    From sdk with Apache License 2.0 4 votes vote down vote up
/**
 * Electronic serial number of the netHSM device. Use Thales anonkneti utility to find the netHSM ESN.
 * @return esn
**/
@Schema(required = true, description = "Electronic serial number of the netHSM device. Use Thales anonkneti utility to find the netHSM ESN.")
public String getEsn() {
  return esn;
}
 
Example #27
Source File: BackupConfigurationApiResponse.java    From sdk with Apache License 2.0 4 votes vote down vote up
/**
 * Get count
 * @return count
**/
@Schema(required = true, description = "")
public Integer getCount() {
  return count;
}
 
Example #28
Source File: ApplicationPersistenceProfile.java    From sdk with Apache License 2.0 4 votes vote down vote up
/**
 * Get ipPersistenceProfile
 * @return ipPersistenceProfile
**/
@Schema(description = "")
public IPPersistenceProfile getIpPersistenceProfile() {
  return ipPersistenceProfile;
}
 
Example #29
Source File: AwsConfiguration.java    From sdk with Apache License 2.0 4 votes vote down vote up
/**
 * Use SNS/SQS based notifications for monitoring Auto Scaling Groups. Field introduced in 17.1.3.
 * @return useSnsSqs
**/
@Schema(description = "Use SNS/SQS based notifications for monitoring Auto Scaling Groups. Field introduced in 17.1.3.")
public Boolean isUseSnsSqs() {
  return useSnsSqs;
}
 
Example #30
Source File: ControllerPropertiesApiResponse.java    From sdk with Apache License 2.0 4 votes vote down vote up
/**
 * Get results
 * @return results
**/
@Schema(required = true, description = "")
public List<ControllerProperties> getResults() {
  return results;
}