Swagger common strings refactoring
This commit is contained in:
parent
fe26af8055
commit
d44d420763
|
@ -165,8 +165,8 @@ public class DescriptionController {
|
|||
@OperationWithTenantHeader(summary = "Query all descriptions", description = SwaggerHelpers.Description.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Description.endpoint_query_request_body, content = @Content(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "Pagination and projection",
|
||||
description = "Simple paginated request using a property projection list and pagination info",
|
||||
name = SwaggerHelpers.Commons.pagination_example,
|
||||
description = SwaggerHelpers.Commons.pagination_example_description,
|
||||
value = SwaggerHelpers.Description.endpoint_query_request_body_example
|
||||
)
|
||||
}
|
||||
|
@ -177,8 +177,8 @@ public class DescriptionController {
|
|||
)
|
||||
),
|
||||
examples = @ExampleObject(
|
||||
name = "First page",
|
||||
description = "Example with the first page of paginated results",
|
||||
name = SwaggerHelpers.Commons.pagination_response_example,
|
||||
description = SwaggerHelpers.Commons.pagination_response_example_description,
|
||||
value = SwaggerHelpers.Description.endpoint_query_response_example
|
||||
))))
|
||||
public QueryResult<Description> query(@RequestBody DescriptionLookup lookup) throws MyApplicationException, MyForbiddenException {
|
||||
|
|
|
@ -101,8 +101,8 @@ public class DescriptionTemplateController {
|
|||
@OperationWithTenantHeader(summary = "Query all description templates", description = SwaggerHelpers.DescriptionTemplate.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.DescriptionTemplate.endpoint_query_request_body, content = @Content(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "Pagination and projection",
|
||||
description = "Simple paginated request using a property projection list and pagination info",
|
||||
name = SwaggerHelpers.Commons.pagination_example,
|
||||
description = SwaggerHelpers.Commons.pagination_example_description,
|
||||
value = SwaggerHelpers.DescriptionTemplate.endpoint_query_request_body_example
|
||||
)
|
||||
}
|
||||
|
@ -113,8 +113,8 @@ public class DescriptionTemplateController {
|
|||
)
|
||||
),
|
||||
examples = @ExampleObject(
|
||||
name = "First page",
|
||||
description = "Example with the first page of paginated results",
|
||||
name = SwaggerHelpers.Commons.pagination_response_example,
|
||||
description = SwaggerHelpers.Commons.pagination_response_example_description,
|
||||
value = SwaggerHelpers.DescriptionTemplate.endpoint_query_response_example
|
||||
))))
|
||||
public QueryResult<DescriptionTemplate> query(@RequestBody DescriptionTemplateLookup lookup) throws MyApplicationException, MyForbiddenException {
|
||||
|
|
|
@ -82,8 +82,8 @@ public class DescriptionTemplateTypeController {
|
|||
@OperationWithTenantHeader(summary = "Query all description template types", description = SwaggerHelpers.DescriptionTemplateType.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.DescriptionTemplateType.endpoint_query_request_body, content = @Content(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "Pagination and projection",
|
||||
description = "Simple paginated request using a property projection list and pagination info",
|
||||
name = SwaggerHelpers.Commons.pagination_example,
|
||||
description = SwaggerHelpers.Commons.pagination_example_description,
|
||||
value = SwaggerHelpers.DescriptionTemplateType.endpoint_query_request_body_example
|
||||
)
|
||||
}
|
||||
|
@ -94,8 +94,8 @@ public class DescriptionTemplateTypeController {
|
|||
)
|
||||
),
|
||||
examples = @ExampleObject(
|
||||
name = "First page",
|
||||
description = "Example with the first page of paginated results",
|
||||
name = SwaggerHelpers.Commons.pagination_response_example,
|
||||
description = SwaggerHelpers.Commons.pagination_response_example_description,
|
||||
value = SwaggerHelpers.DescriptionTemplateType.endpoint_query_response_example
|
||||
))))
|
||||
public QueryResult<DescriptionTemplateType> Query(@RequestBody DescriptionTemplateTypeLookup lookup) throws MyApplicationException, MyForbiddenException {
|
||||
|
|
|
@ -82,8 +82,8 @@ public class EntityDoiController {
|
|||
@OperationWithTenantHeader(summary = "Query all entity dois", description = SwaggerHelpers.EntityDoi.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.EntityDoi.endpoint_query_request_body, content = @Content(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "Pagination and projection",
|
||||
description = "Simple paginated request using a property projection list and pagination info",
|
||||
name = SwaggerHelpers.Commons.pagination_example,
|
||||
description = SwaggerHelpers.Commons.pagination_example_description,
|
||||
value = SwaggerHelpers.EntityDoi.endpoint_query_request_body_example
|
||||
)
|
||||
}
|
||||
|
@ -94,8 +94,8 @@ public class EntityDoiController {
|
|||
)
|
||||
),
|
||||
examples = @ExampleObject(
|
||||
name = "First page",
|
||||
description = "Example with the first page of paginated results",
|
||||
name = SwaggerHelpers.Commons.pagination_response_example,
|
||||
description = SwaggerHelpers.Commons.pagination_response_example_description,
|
||||
value = SwaggerHelpers.EntityDoi.endpoint_query_response_example
|
||||
))))
|
||||
public QueryResult<EntityDoi> query(@RequestBody EntityDoiLookup lookup) throws MyApplicationException, MyForbiddenException {
|
||||
|
|
|
@ -105,8 +105,8 @@ public class LockController {
|
|||
@OperationWithTenantHeader(summary = "Query all locked entities", description = SwaggerHelpers.Lock.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Lock.endpoint_query_request_body, content = @Content(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "Pagination and projection",
|
||||
description = "Simple paginated request using a property projection list and pagination info",
|
||||
name = SwaggerHelpers.Commons.pagination_example,
|
||||
description = SwaggerHelpers.Commons.pagination_example_description,
|
||||
value = SwaggerHelpers.Lock.endpoint_query_request_body_example
|
||||
)
|
||||
}
|
||||
|
@ -117,8 +117,8 @@ public class LockController {
|
|||
)
|
||||
),
|
||||
examples = @ExampleObject(
|
||||
name = "First page",
|
||||
description = "Example with the first page of paginated results",
|
||||
name = SwaggerHelpers.Commons.pagination_response_example,
|
||||
description = SwaggerHelpers.Commons.pagination_response_example_description,
|
||||
value = SwaggerHelpers.Lock.endpoint_query_response_example
|
||||
))))
|
||||
public QueryResult<Lock> query(@RequestBody LockLookup lookup) throws MyApplicationException, MyForbiddenException, InvalidAlgorithmParameterException, NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, BadPaddingException, InvalidKeyException {
|
||||
|
|
|
@ -94,8 +94,8 @@ public class PlanBlueprintController {
|
|||
@OperationWithTenantHeader(summary = "Query all plan blueprints", description = SwaggerHelpers.PlanBlueprint.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.PlanBlueprint.endpoint_query_request_body, content = @Content(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "Pagination and projection",
|
||||
description = "Simple paginated request using a property projection list and pagination info",
|
||||
name = SwaggerHelpers.Commons.pagination_example,
|
||||
description = SwaggerHelpers.Commons.pagination_example_description,
|
||||
value = SwaggerHelpers.PlanBlueprint.endpoint_query_request_body_example
|
||||
)
|
||||
}
|
||||
|
@ -106,8 +106,8 @@ public class PlanBlueprintController {
|
|||
)
|
||||
),
|
||||
examples = @ExampleObject(
|
||||
name = "First page",
|
||||
description = "Example with the first page of paginated results",
|
||||
name = SwaggerHelpers.Commons.pagination_response_example,
|
||||
description = SwaggerHelpers.Commons.pagination_response_example_description,
|
||||
value = SwaggerHelpers.PlanBlueprint.endpoint_query_response_example
|
||||
))))
|
||||
public QueryResult<PlanBlueprint> query(@RequestBody PlanBlueprintLookup lookup) throws MyApplicationException, MyForbiddenException {
|
||||
|
|
|
@ -147,8 +147,8 @@ public class PlanController {
|
|||
|
||||
@PostMapping("query")
|
||||
@OperationWithTenantHeader(summary = "Query all plans", description = SwaggerHelpers.Plan.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Plan.endpoint_query_request_body, content = @Content(examples = @ExampleObject(
|
||||
name = "Pagination and projection",
|
||||
description = "Simple paginated request using a property projection list and pagination info",
|
||||
name = SwaggerHelpers.Commons.pagination_example,
|
||||
description = SwaggerHelpers.Commons.pagination_example_description,
|
||||
value = SwaggerHelpers.Plan.endpoint_query_request_body_example
|
||||
))), responses = @ApiResponse(description = "OK", responseCode = "200", content = @Content(
|
||||
array = @ArraySchema(
|
||||
|
@ -157,8 +157,8 @@ public class PlanController {
|
|||
)
|
||||
),
|
||||
examples = @ExampleObject(
|
||||
name = "First page",
|
||||
description = "Example with the first page of paginated results",
|
||||
name = SwaggerHelpers.Commons.pagination_response_example,
|
||||
description = SwaggerHelpers.Commons.pagination_response_example_description,
|
||||
value = SwaggerHelpers.Plan.endpoint_query_response_example
|
||||
))))
|
||||
public QueryResult<Plan> Query(@RequestBody PlanLookup lookup) throws MyApplicationException, MyForbiddenException {
|
||||
|
|
|
@ -92,8 +92,8 @@ public class ReferenceController {
|
|||
@OperationWithTenantHeader(summary = "Query all references", description = SwaggerHelpers.Reference.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Reference.endpoint_query_request_body, content = @Content(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "Pagination and projection",
|
||||
description = "Simple paginated request using a property projection list and pagination info",
|
||||
name = SwaggerHelpers.Commons.pagination_example,
|
||||
description = SwaggerHelpers.Commons.pagination_example_description,
|
||||
value = SwaggerHelpers.Reference.endpoint_query_request_body_example
|
||||
)
|
||||
}
|
||||
|
@ -104,8 +104,8 @@ public class ReferenceController {
|
|||
)
|
||||
),
|
||||
examples = @ExampleObject(
|
||||
name = "First page",
|
||||
description = "Example with the first page of paginated results",
|
||||
name = SwaggerHelpers.Commons.pagination_response_example,
|
||||
description = SwaggerHelpers.Commons.pagination_response_example_description,
|
||||
value = SwaggerHelpers.Reference.endpoint_query_response_example
|
||||
))))
|
||||
public QueryResult<Reference> query(@RequestBody ReferenceLookup lookup) throws MyApplicationException, MyForbiddenException {
|
||||
|
@ -127,8 +127,8 @@ public class ReferenceController {
|
|||
@OperationWithTenantHeader(summary = "Query all references including results from external APIs", description = SwaggerHelpers.Reference.endpoint_search, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Reference.endpoint_search_request_body, content = @Content(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "Pagination and projection",
|
||||
description = "Simple paginated request using a property projection list and pagination info",
|
||||
name = SwaggerHelpers.Commons.pagination_example,
|
||||
description = SwaggerHelpers.Commons.pagination_example_description,
|
||||
value = SwaggerHelpers.Reference.endpoint_search_request_body_example
|
||||
)
|
||||
}
|
||||
|
@ -139,8 +139,8 @@ public class ReferenceController {
|
|||
)
|
||||
),
|
||||
examples = @ExampleObject(
|
||||
name = "First page",
|
||||
description = "Example with the first page of paginated results",
|
||||
name = SwaggerHelpers.Commons.pagination_response_example,
|
||||
description = SwaggerHelpers.Commons.pagination_response_example_description,
|
||||
value = SwaggerHelpers.Reference.endpoint_search_response_example
|
||||
))))
|
||||
@Swagger404
|
||||
|
|
|
@ -94,8 +94,8 @@ public class ReferenceTypeController{
|
|||
@OperationWithTenantHeader(summary = "Query all reference types", description = SwaggerHelpers.ReferenceType.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.ReferenceType.endpoint_query_request_body, content = @Content(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "Pagination and projection",
|
||||
description = "Simple paginated request using a property projection list and pagination info",
|
||||
name = SwaggerHelpers.Commons.pagination_example,
|
||||
description = SwaggerHelpers.Commons.pagination_example_description,
|
||||
value = SwaggerHelpers.ReferenceType.endpoint_query_request_body_example
|
||||
)
|
||||
}
|
||||
|
@ -106,8 +106,8 @@ public class ReferenceTypeController{
|
|||
)
|
||||
),
|
||||
examples = @ExampleObject(
|
||||
name = "First page",
|
||||
description = "Example with the first page of paginated results",
|
||||
name = SwaggerHelpers.Commons.pagination_response_example,
|
||||
description = SwaggerHelpers.Commons.pagination_response_example_description,
|
||||
value = SwaggerHelpers.ReferenceType.endpoint_query_response_example
|
||||
))))
|
||||
public QueryResult<ReferenceType> query(@RequestBody ReferenceTypeLookup lookup) throws MyApplicationException, MyForbiddenException {
|
||||
|
|
|
@ -81,8 +81,8 @@ public class TagController {
|
|||
@OperationWithTenantHeader(summary = "Query all tags", description = SwaggerHelpers.Tag.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.Tag.endpoint_query_request_body, content = @Content(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "Pagination and projection",
|
||||
description = "Simple paginated request using a property projection list and pagination info",
|
||||
name = SwaggerHelpers.Commons.pagination_example,
|
||||
description = SwaggerHelpers.Commons.pagination_example_description,
|
||||
value = SwaggerHelpers.Tag.endpoint_query_request_body_example
|
||||
)
|
||||
}
|
||||
|
@ -93,8 +93,8 @@ public class TagController {
|
|||
)
|
||||
),
|
||||
examples = @ExampleObject(
|
||||
name = "First page",
|
||||
description = "Example with the first page of paginated results",
|
||||
name = SwaggerHelpers.Commons.pagination_response_example,
|
||||
description = SwaggerHelpers.Commons.pagination_response_example_description,
|
||||
value = SwaggerHelpers.Tag.endpoint_query_response_example
|
||||
))))
|
||||
public QueryResult<Tag> Query(@RequestBody TagLookup lookup) throws MyApplicationException, MyForbiddenException {
|
||||
|
|
|
@ -111,8 +111,8 @@ public class UserController {
|
|||
@OperationWithTenantHeader(summary = "Query all users", description = SwaggerHelpers.User.endpoint_query, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.User.endpoint_query_request_body, content = @Content(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "Pagination and projection",
|
||||
description = "Simple paginated request using a property projection list and pagination info",
|
||||
name = SwaggerHelpers.Commons.pagination_example,
|
||||
description = SwaggerHelpers.Commons.pagination_example_description,
|
||||
value = SwaggerHelpers.User.endpoint_query_request_body_example
|
||||
)
|
||||
}
|
||||
|
@ -123,8 +123,8 @@ public class UserController {
|
|||
)
|
||||
),
|
||||
examples = @ExampleObject(
|
||||
name = "First page",
|
||||
description = "Example with the first page of paginated results",
|
||||
name = SwaggerHelpers.Commons.pagination_response_example,
|
||||
description = SwaggerHelpers.Commons.pagination_response_example_description,
|
||||
value = SwaggerHelpers.User.endpoint_query_response_example
|
||||
))))
|
||||
public QueryResult<User> query(@RequestBody UserLookup lookup) throws MyApplicationException, MyForbiddenException {
|
||||
|
@ -147,8 +147,8 @@ public class UserController {
|
|||
@OperationWithTenantHeader(summary = "Query all plan associated users", description = SwaggerHelpers.User.endpoint_query_plan_associated, requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = SwaggerHelpers.User.endpoint_query_request_body, content = @Content(
|
||||
examples = {
|
||||
@ExampleObject(
|
||||
name = "Pagination and projection",
|
||||
description = "Simple paginated request using a property projection list and pagination info",
|
||||
name = SwaggerHelpers.Commons.pagination_example,
|
||||
description = SwaggerHelpers.Commons.pagination_example_description,
|
||||
value = SwaggerHelpers.User.endpoint_query_plan_associated_request_body_example
|
||||
)
|
||||
}
|
||||
|
@ -159,8 +159,8 @@ public class UserController {
|
|||
)
|
||||
),
|
||||
examples = @ExampleObject(
|
||||
name = "First page",
|
||||
description = "Example with the first page of paginated results",
|
||||
name = SwaggerHelpers.Commons.pagination_response_example,
|
||||
description = SwaggerHelpers.Commons.pagination_response_example_description,
|
||||
value = SwaggerHelpers.User.endpoint_query_plan_associated_response_example
|
||||
))))
|
||||
public QueryResult<PlanAssociatedUser> queryPlanAssociated(@RequestBody UserLookup lookup) throws MyApplicationException, MyForbiddenException {
|
||||
|
|
|
@ -8,6 +8,26 @@ public final class SwaggerHelpers {
|
|||
"""
|
||||
This is an object containing a list of the properties you wish to include in the response, similar to the 'project' attribute on queries.
|
||||
""";
|
||||
|
||||
public static final String pagination_example =
|
||||
"""
|
||||
Pagination and projection
|
||||
""";
|
||||
|
||||
public static final String pagination_example_description =
|
||||
"""
|
||||
Simple paginated request using a property projection list and pagination info
|
||||
""";
|
||||
|
||||
public static final String pagination_response_example =
|
||||
"""
|
||||
Pagination and projection
|
||||
""";
|
||||
|
||||
public static final String pagination_response_example_description =
|
||||
"""
|
||||
Simple paginated request using a property projection list and pagination info
|
||||
""";
|
||||
}
|
||||
|
||||
public static final class Errors {
|
||||
|
|
Loading…
Reference in New Issue