Redundant Information

Redundant InformationRedundant Information
eschuetze Mitarbeiter fragte vor 2 Jahren
Why are properties already defined in the path variable repeatedly stated in the body of the response? Example: in /operations/{operationId}/recordedOperationPhases the operationId is part of the URL. Then why is it repeated in every element: “elements”: [ { “workplaceId”: “string”, “operationId”: “string”, “operationPhaseId”: “string”, “startDate”: “2019-07-06T09:43:58.798Z”, “endDate”: “2019-07-06T09:43:58.798Z” } Per page (with a page size of 100 elements) the same UUID is output here unnecessarily 100 times in the response.
1 Antworten
victor Mitarbeiter antwortete vor 2 Jahren

The objection is justified in principle, but in resource design the question must always be asked whether a separate data structure must be defined for each resource or whether it does not make more sense to use existing data structures more than once. Otherwise, the number of defined data structures becomes unmanageably large at some point.

In this case, the decision was made to use the same data structure in the response of the following two resources:




As a consequence, however, workplaceId and operationId must be returned in the response of both resources.