New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A new keyword "Last REST Instance" is implemented #105
base: master
Are you sure you want to change the base?
Conversation
@TeddyTeddy This functionality seems to exist already? You can give a |
@asimell , as per your comment:
Hi! Yes, output keyword does write the request & response schema to a file, but it does not write the whole instance. The instance is a larger entity, which is composed of:
If we want to have the instance as a record into a file, this utility keyword "Last REST Instance" would be helpful. |
I think @asimell is correct. There is a way to achieve above without adding a new keyword. |
request_properties["body"] = self._new_schema(request["body"]) | ||
request_properties["query"] = self._new_schema(request["query"]) | ||
response_properties["body"] = self._new_schema(response["body"]) | ||
self._form_sub_schema(request_properties, request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asyrjasalo @asimell Sure, you can opt out my "Last REST Instance" keyword; but one change here that you might need to take into consideration is that before my changes only request & response body were outputted, but with my changes every key/value pair in the request & response are now outputted via "Last REST Instance" keyword.
Also, the end user of the library would have to write & maintain a function containing at least 10 lines of code, while
the library itself has the instance data already ready to be written into a file. Imagine that tens of users does the same. Isn't that a wasteful effort from the end users' perspective?
I have nothing further to say. Thanks anyway bringing life back to this important library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only request & response body were outputted
Incorrect. If you call Output
without any parameters it outputs the full request and response object. You can then redirect this output into a file with the file_path
argument, e.g Output file_path=my_output.json
There's also Output Schema
to output the schema only and you can give a file_path
argument to that keyword as well.
This keyword allows the very last instance to be written to a file.
This becomes handy, when you just made a request and you want to get the instance for it.
A sample usage would be: