diff --git a/oparl-server/src/main/java/de/twomartens/oparlservice/control/OParlController.java b/oparl-server/src/main/java/de/twomartens/oparlservice/control/OParlController.java index 3a2ae91..4e7b82b 100644 --- a/oparl-server/src/main/java/de/twomartens/oparlservice/control/OParlController.java +++ b/oparl-server/src/main/java/de/twomartens/oparlservice/control/OParlController.java @@ -44,7 +44,7 @@ public class OParlController { @Operation(summary = "List of all agenda items in body", description = "returns a list of all agenda items in requested body", responses = { @ApiResponse(description = "Successful Operation", responseCode = "200", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.ObjectListAgendaItem.class))), @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorObject.class))) }) @@ -62,7 +62,7 @@ public class OParlController { @Operation(summary = "List of available bodies", description = "returns a list of available bodies in this OParl system", responses = { @ApiResponse(description = "Successful Operation", responseCode = "200", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))) + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.ObjectListBody.class))) }) public ObjectList bodies() { log.info("method invoked /v1.1/bodies"); @@ -107,7 +107,7 @@ public class OParlController { @Operation(summary = "List of all consultations in body", description = "returns a list of all consultations in requested body", responses = { @ApiResponse(description = "Successful Operation", responseCode = "200", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.ObjectListConsultation.class))), @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorObject.class))) }) @@ -142,7 +142,7 @@ public class OParlController { @Operation(summary = "List of all files in body", description = "returns a list of all files in requested body", responses = { @ApiResponse(description = "Successful Operation", responseCode = "200", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.ObjectListFile.class))), @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorObject.class))) }) @@ -176,7 +176,7 @@ public class OParlController { @GetMapping("/body/{id}/legislativeTerms") @Operation(summary = "List of all legislative terms of a body", description = "returns a list of all legislative terms of requested body", responses = { @ApiResponse(description = "Successful Operation", responseCode = "200", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.ObjectListLegislativeTerm.class))), @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorObject.class))) }) @@ -211,7 +211,7 @@ public class OParlController { @Operation(summary = "List of all locations in body", description = "returns a list of all locations in requested body", responses = { @ApiResponse(description = "Successful Operation", responseCode = "200", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.ObjectListLocation.class))), @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorObject.class))) }) @@ -246,7 +246,7 @@ public class OParlController { @Operation(summary = "List of all meetings in body", description = "returns a list of all meetings in requested body", responses = { @ApiResponse(description = "Successful Operation", responseCode = "200", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.ObjectListMeeting.class))), @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorObject.class))) }) @@ -264,7 +264,7 @@ public class OParlController { @Operation(summary = "List of all meetings in organization", description = "returns a list of all meetings in requested organization", responses = { @ApiResponse(description = "Successful Operation", responseCode = "200", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.ObjectListMeeting.class))), @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorObject.class))) }) @@ -298,7 +298,7 @@ public class OParlController { @GetMapping("/body/{id}/memberships") @Operation(summary = "List of all memberships in body", description = "returns a list of all memberships in requested body", responses = { @ApiResponse(description = "Successful Operation", responseCode = "200", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.ObjectListMembership.class))), @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorObject.class))) }) @@ -316,7 +316,7 @@ public class OParlController { @Operation(summary = "List of all memberships in organization", description = "returns a list of all memberships in requested organization", responses = { @ApiResponse(description = "Successful Operation", responseCode = "200", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.ObjectListMembership.class))), @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorObject.class))) }) @@ -359,7 +359,7 @@ public class OParlController { @GetMapping("/body/{id}/organizations") @Operation(summary = "List of all organizations in body", description = "returns a list of all organizations in requested body", responses = { @ApiResponse(description = "Successful Operation", responseCode = "200", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.ObjectListOrganization.class))), @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorObject.class))) }) @@ -394,7 +394,7 @@ public class OParlController { @Operation(summary = "List of all papers in body", description = "returns a list of all papers in requested body", responses = { @ApiResponse(description = "Successful Operation", responseCode = "200", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.ObjectListPaper.class))), @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorObject.class))) }) @@ -428,7 +428,7 @@ public class OParlController { @GetMapping("/body/{id}/persons") @Operation(summary = "List of all persons in body", description = "returns a list of all persons in requested body", responses = { @ApiResponse(description = "Successful Operation", responseCode = "200", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.ObjectListPerson.class))), @ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorObject.class))) }) diff --git a/oparl-server/src/main/java/de/twomartens/oparlservice/entity/ObjectList.java b/oparl-server/src/main/java/de/twomartens/oparlservice/entity/ObjectList.java index de6e50c..c32ba60 100644 --- a/oparl-server/src/main/java/de/twomartens/oparlservice/entity/ObjectList.java +++ b/oparl-server/src/main/java/de/twomartens/oparlservice/entity/ObjectList.java @@ -25,4 +25,16 @@ public class ObjectList { @NonNull @Schema(description = "contains links related to this list", required = true) private final Links links; + + public static class ObjectListAgendaItem extends ObjectList {} + public static class ObjectListBody extends ObjectList {} + public static class ObjectListConsultation extends ObjectList {} + public static class ObjectListFile extends ObjectList {} + public static class ObjectListLegislativeTerm extends ObjectList {} + public static class ObjectListLocation extends ObjectList {} + public static class ObjectListMeeting extends ObjectList {} + public static class ObjectListMembership extends ObjectList {} + public static class ObjectListOrganization extends ObjectList {} + public static class ObjectListPaper extends ObjectList {} + public static class ObjectListPerson extends ObjectList {} }