Issue
The application project requires custom response codes (for example, 201, 400, 404, 500) in the Swagger of a REST service; however, this is not available in Mendix.
Environment
Studio Pro (all versions)
Cause
Mendix does not support the automatic publishing of multiple custom response codes (for example, 201, 400, 404, 500) in the Swagger of a REST service; only 200 is generated by default.
Solution / Workaround
To display different response codes in the Swagger documentation, manual adjustments are required.
The only direct way is to manually edit the swagger.json file exported by Mendix and add the desired responses to each operation.
Changes to the swagger.json can be overwritten by Mendix when restarting or republishing, so this approach requires recurring maintenance.
Internal information related
- 260250
- C0A044PPS/p1758547323445689
Additional information
Not Applicable
0 Comments