consilience / openapi-generator-psr18

Templates to generate a PSR-18/PSR-17/PSR-7 client package for PHP
Apache License 2.0
2 stars 0 forks source link

Support serialisation from internal field names #10

Open judgej opened 5 years ago

judgej commented 5 years ago

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.