The serialisation method assumes its input is going to be the payload of a Serverr Request (and specifically a JSON payload). The data used to construct those models then has to be formatted using the field names as they are transmitted over HTTP.
For example, am RFC 7807 response has a transmitted field invalid-params. This can be set on the model using setInvalidParams('$foo) but the array element when initialising (deserialising) must be invalid-params. The obvious key invalidParams does not work.
This is useful when constructing responses to inbound requests. This also assumes the package generated is more an SDK handling all message models, and supports sending using a PSR-18 client, rather than just being a client package.
The serialisation method assumes its input is going to be the payload of a Serverr Request (and specifically a JSON payload). The data used to construct those models then has to be formatted using the field names as they are transmitted over HTTP.
For example, am RFC 7807 response has a transmitted field
invalid-params
. This can be set on the model usingsetInvalidParams('$foo)
but the array element when initialising (deserialising) must beinvalid-params
. The obvious keyinvalidParams
does not work.This is useful when constructing responses to inbound requests. This also assumes the package generated is more an SDK handling all message models, and supports sending using a PSR-18 client, rather than just being a client package.