Redundant Information

Redundant InformationRedundant Information
eschuetze Staff asked 11 months ago
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 Answers
victor Staff answered 7 months ago

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.

New Event

Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nulla vitae elit libero, a pharetra augue. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.