You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sendWith() function in a Request class calls SwaggerClient::make() with a list of valid Model names per response code, and expects to get back an instance of one of these.
When the make() function is manually written in the implementation of the SwaggerClient, the author needs to add code to go through each setter on the Model to set its value from the data they have after doing the request (typically the response after making the request). The make() function needs to do this (or link to code doing this) for all Models it may have to return, all of which currently needs to be written manually (or at least is not provided by this repository).
Given it should be the output of the API, this data should be in a standard format per Model, with property fields as in the swagger file and used by this repository to generate the Model.
As such I am proposing that each Model class gets a 'generate'/'populate' function of some kind that takes in a stdClass/other data store, and for each of the keys defined in the swagger file, if present in the provided data store, sets the matching field in the Model to that value. The make() function can then use that function, that will get regenerated with the Model if say the swagger file/Model changes, to put the data from the response into an instance of the Model.
The text was updated successfully, but these errors were encountered:
The sendWith() function in a Request class calls SwaggerClient::make() with a list of valid Model names per response code, and expects to get back an instance of one of these.
When the make() function is manually written in the implementation of the SwaggerClient, the author needs to add code to go through each setter on the Model to set its value from the data they have after doing the request (typically the response after making the request). The make() function needs to do this (or link to code doing this) for all Models it may have to return, all of which currently needs to be written manually (or at least is not provided by this repository).
Given it should be the output of the API, this data should be in a standard format per Model, with property fields as in the swagger file and used by this repository to generate the Model.
As such I am proposing that each Model class gets a 'generate'/'populate' function of some kind that takes in a stdClass/other data store, and for each of the keys defined in the swagger file, if present in the provided data store, sets the matching field in the Model to that value. The make() function can then use that function, that will get regenerated with the Model if say the swagger file/Model changes, to put the data from the response into an instance of the Model.
The text was updated successfully, but these errors were encountered: