Hi
@Jonathan Goldberg,
@Kamal Maghsoudlou,
I've faced the trouble, similar to
@Princy Rodrigues. Not exactly with TMF622, but with the whole TMF630 API guideline.
As you mentioned above, the standard non-success HTTP reply returns only a single {errorMessage} object.
I understood the idea about the ServiceOrder, and it's list of errors caused an order status change.
But how can I return a list of errors, appearing on the entity creation as well?
For example, we are trying to create a Customer (POST /customer). And the operator has made several mistakes on UI at once:
- The Name contains a digit
- The birthdate is a 2022 (to young to be a Customer)
- A value in the characteristic "Region" is not supported (e.g. we don't have an office there).
The easiest way for me - is to return such an error:
400 Bad Request
{
errors: [
{
"code": "ERR001",
"reason": "Error in Name",
"message": "The Customer name must not contain digits or special symbols"
},
{
"code": "ERR002",
"reason": "Error in date of birth",
"message": "The specified date of birth must be earlier 2010"
},
{
"code": "ERR003",
"reason": "Characteristic error",
"message": "The characteristic "Region" is not supported"
}]
}
But this is against the rules?
I don't want to successfully create the Customer (201 Created) in the error status and return the errors list in a nested collection.
------------------------------
Petr Kolotushkin
Netcracker Technology
------------------------------
Original Message:
Sent: Sep 30, 2020 02:23
From: Jonathan Goldberg
Subject: TMF Standard returning Multiple Errors (TMF622)
Hi Princy
Currently the general Error structure is returned as a payload for all non-success HTTP statuses (as you can see from the Open API swagger files). But this is a single structure, not an array.
Specifically for orders, we have started to introduce a new pattern, whereby the order structure itself will include a list of errors. This will probably answer your use case.
It is being done initially for Service Order (TMF641), presumably it will eventually reach Product and Resource Order as well. If you want to align your current implementation with the pattern, suggest you reach out to @Kamal Maghsoudlou to find out details of the change.
Hope it helps.
------------------------------
Jonathan Goldberg
Amdocs Management Limited
Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
Original Message:
Sent: Sep 28, 2020 23:39
From: Princy Rodrigues
Subject: TMF Standard returning Multiple Errors (TMF622)
Hi Team,
I want to know if TMF Standard supports returning multiple error codes/message in form of array in the Synchronous Response.
I am using TMF622 for handling Product Order, there are set of Business Validation that I need to perform before placing the Order. My requirement is perform all the validates in one go and return all errors encounters back to the user in 1 single response. So, that User can fix/correct all issue together and repost a error free request. Does TMF Standard support this feature of sending back multiple errors in form on array/occurrence. I have been to the standard guideline of TMF630 & also read through TMF622 but I did not find anything mentioned for this. Can you please assist.
Example :
400 Bad Request
{
"code": "ERR001",
"reason": "Missing mandatory field",
"message": "Please provide and Authorisation header"
"code1": "<Code1>",
"reason1": "<reason1>",
"message1": "<message1>"
......
}
------------------------------
Princy Rodrigues
BT Group plc
------------------------------