camunda / camunda-bpm-platform

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.
https://camunda.com/
Apache License 2.0
4.11k stars 1.55k forks source link

Process Definition XML endpoint returns wrong HTTP code #3116

Closed mboskamp closed 1 year ago

mboskamp commented 1 year ago

Environment (Required on creation)

Any Camunda version

Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket)

When calling the process-definition/{id}/xml endpoint with an id that is not valid, the documented HTTP response code is 404. Instead the REST API returns a 400.

Steps to reproduce (Required on creation)

Call process-definition/{id}/xml with an invalid id.

Observed Behavior (Required on creation)

The HTTP response code is 400.

Expected behavior (Required on creation)

The HTTP response code is 404.

Root Cause (Required on prioritization)

https://github.com/camunda/camunda-bpm-platform/blob/1d94a5bfe7851e81ba6d10b2c006b3dc3acedeb5/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/sub/repository/impl/ProcessDefinitionResourceImpl.java#L267

Solution Ideas

Hints

This should be documented in the REST API and probably also mentioned in the migration guide.

Links

Related to https://jira.camunda.com/browse/SUPPORT-15646

Breakdown

Dev2QA handover

mboskamp commented 1 year ago

@ThorbenLindhauer, assigned to you for prioritization

ThorbenLindhauer commented 1 year ago

The CI failures are OOM exceptions in wls-compatibility. I don't have time to rootcause them, but I'm fairly certain they are not caused by the changes.

tmetzke commented 1 year ago

Review complete, let's wait for code unfreeze to merge this 👍 🙂