class StepActionHandler extends BaseHandler {

    @POST
    @Path("/descriptor")
    @Produces(MediaType.APPLICATION_JSON)
    @Operation(description = "Retrieves enriched step definitions, that is a list of steps where each step has adapted input/output data shapes " +
                    "defined with respect to the given shape variants")
    @ApiResponse(responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = Step.class))),
        description = "List of enriched steps")
    public Response enrichStepMetadata(List<Step> steps) {
        List<Step> enriched = new ArrayList<>(steps.size());

        for (int i = 0; i < steps.size(); i++) {
            Step step = steps.get(i);
            final Optional<StepMetadataHandler> metadataHandler = findStepMetadataHandler(step.getStepKind());

            if (metadataHandler.isPresent()) {
                StepMetadataHandler handler = metadataHandler.get();

                List<Step> previousSteps;
                if (i == 0) {
                    previousSteps = Collections.singletonList(step);
                } else {
                    previousSteps = enriched.subList(0, i);
                }

                final DynamicActionMetadata metadata = handler.createMetadata(step, previousSteps, steps.subList(i + 1, steps.size()));
                final DynamicActionMetadata enrichedMetadata = handler.handle(metadata);
                if (enrichedMetadata.equals(DynamicActionMetadata.NOTHING)) {
                    enriched.add(step);
                } else {
                    enriched.add(applyMetadata(step, enrichedMetadata));
                }
            } else {
                enriched.add(step);
            }
        }

        return Response.status(Status.OK).entity(enriched).build();
    }

    public  StepActionHandler(final DataManager dataMgr);

}