diff --git a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionController.java b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionController.java index 6e73adec2..a42c2599e 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionController.java @@ -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 query(@RequestBody DescriptionLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateController.java b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateController.java index dc82bdf75..77d2eee27 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateController.java @@ -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 query(@RequestBody DescriptionTemplateLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateTypeController.java b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateTypeController.java index dabe332c1..44944a3a2 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateTypeController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionTemplateTypeController.java @@ -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 Query(@RequestBody DescriptionTemplateTypeLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/EntityDoiController.java b/backend/web/src/main/java/org/opencdmp/controllers/EntityDoiController.java index 742e091d5..ac5902d99 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/EntityDoiController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/EntityDoiController.java @@ -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 query(@RequestBody EntityDoiLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/LockController.java b/backend/web/src/main/java/org/opencdmp/controllers/LockController.java index ee78a1498..8966f6f92 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/LockController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/LockController.java @@ -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 query(@RequestBody LockLookup lookup) throws MyApplicationException, MyForbiddenException, InvalidAlgorithmParameterException, NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, BadPaddingException, InvalidKeyException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/PlanBlueprintController.java b/backend/web/src/main/java/org/opencdmp/controllers/PlanBlueprintController.java index 8ec72dc52..44937bdbb 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/PlanBlueprintController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/PlanBlueprintController.java @@ -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 query(@RequestBody PlanBlueprintLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/PlanController.java b/backend/web/src/main/java/org/opencdmp/controllers/PlanController.java index 08404887f..3a8ce31aa 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/PlanController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/PlanController.java @@ -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 Query(@RequestBody PlanLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/ReferenceController.java b/backend/web/src/main/java/org/opencdmp/controllers/ReferenceController.java index 0085dc0bb..50154041e 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/ReferenceController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/ReferenceController.java @@ -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 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 diff --git a/backend/web/src/main/java/org/opencdmp/controllers/ReferenceTypeController.java b/backend/web/src/main/java/org/opencdmp/controllers/ReferenceTypeController.java index 6c500aac8..f47d022aa 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/ReferenceTypeController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/ReferenceTypeController.java @@ -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 query(@RequestBody ReferenceTypeLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/TagController.java b/backend/web/src/main/java/org/opencdmp/controllers/TagController.java index 5bde81889..c4069a02b 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/TagController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/TagController.java @@ -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 Query(@RequestBody TagLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/UserController.java b/backend/web/src/main/java/org/opencdmp/controllers/UserController.java index 908e8df14..23ad6e1d8 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/UserController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/UserController.java @@ -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 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 queryPlanAssociated(@RequestBody UserLookup lookup) throws MyApplicationException, MyForbiddenException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java b/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java index 34cc0a938..a01110aaf 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java @@ -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 {