Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0054015
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Modules] Openbravo Business APImajoralways2023-11-23 12:062023-12-12 10:44
ReporterjavietxeView Statuspublic 
Assigned ToTriage Platform Conn 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Regression date
Regression introduced by commit
Regression level
Review Assigned To
Regression introduced in release
Summary

0054015: API failing but responding 200

DescriptionWhen an API is called and it has a mapping error, the response seems to be a success response (it is marked as a 200) but the JSON is not valid.
Steps To ReproduceAn example:

- Create a Shipment with a shipment line without setting a bin to it (or deleting it if it's automatically set)
- Through postman, do this call setting the date of the Shipment created
https://livebuilds.openbravo.com/context/retail_modules_pgsql_pi/ws/org.openbravo.api.ExportService/ShipmentInOut/goodsReceiptByMovementDate?movementDate=2012-07-24&_page=1&_pageSize=5 [^]

Check that even the response has a JSON and the response code is a 200, the JSON is not complete.

Check also that in the openbravo.logs it exists a stacktrace with the error. In this example:
ERROR org.openbravo.service.web.BaseWebServiceServlet - Value of property bin is null but it does not accept null values
org.openbravo.base.exception.OBException: Value of property bin is null but it does not accept null values
Proposed SolutionWhen this type of error happens, the response code has to be an error.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0054016 closedramprakash Retail Modules Wrong mapping in shipment lines 
related to defect 0054102 acknowledgedTriage Platform Conn Modules Erroneous export WS response can contain an unterminated json content 

-  Notes
(0158039)
hgbot (developer)
2023-12-11 12:07

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/221 [^]
(0158074)
hgbot (developer)
2023-12-12 10:33

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.api [^]
Changeset: 8518d1f8bf34bb96e1cf40e478f9b6fa6a3bf4aa
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 11-12-2023 11:07:24
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/commit/8518d1f8bf34bb96e1cf40e478f9b6fa6a3bf4aa [^]

fixes BUG-54015: api WS response status is sometimes wrongly set as success

  The response of the api export WS was wrongly marked as success when
the writing of the response data failed.

  This could happen for example if the mapping of one of the exported
items failed.

  Now we are properly setting the status code of the response as an
internal server error (500) in that case.

---
M src-test/org/openbravo/api/service/JSONResponseWriterTest.java
M src/org/openbravo/api/service/JSONResponseWriter.java
---
(0158075)
hgbot (developer)
2023-12-12 10:33

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/221 [^]

- Issue History
Date Modified Username Field Change
2023-11-23 12:06 javietxe New Issue
2023-11-23 12:06 javietxe Assigned To => Triage Platform Conn
2023-11-23 12:06 javietxe Triggers an Emergency Pack => No
2023-11-23 12:24 javietxe Relationship added related to 0054016
2023-11-23 12:29 javietxe Steps to Reproduce Updated View Revisions
2023-12-11 12:07 hgbot Note Added: 0158039
2023-12-12 10:33 hgbot Resolution open => fixed
2023-12-12 10:33 hgbot Status new => closed
2023-12-12 10:33 hgbot Note Added: 0158074
2023-12-12 10:33 hgbot Note Added: 0158075
2023-12-12 10:43 caristu Issue cloned 0054102
2023-12-12 10:43 caristu Relationship added related to 0054102
2023-12-12 10:44 caristu Project Retail Modules => Modules
2023-12-12 10:44 caristu Category Retail API => Openbravo Business API


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker