-
Notifications
You must be signed in to change notification settings - Fork 10
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
Indicate when object property is empty #520
Indicate when object property is empty #520
Conversation
@@ -35,19 +35,22 @@ Possible enum values: | |||
{{/if}} | |||
|
|||
{{#if objectProperties}} | |||
{{#if (eq objectProperties.length 0)}} | |||
This object has no properties. |
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.
This object has no properties. | |
This resource has no properties. |
Should this be "object" or "resource"?
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.
@andrii-balitskyi Is there an example of an object/resource that has no props? Thanks!
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.
It doesn't relate directly to a resource but to a property of a resource. Example: 5641393
(#520)
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.
Ah ha! Now that I saw the example that you linked, I understand. You were correct to use "object."
This is a separate question: What is the use of a property of a resource being an object with no properties? In the example that you linked, there's a result object, but it doesn't have any props, so what purpose does it serve?
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.
Not every action attempt has a result. Attempts without a result return an empty object. I'm not sure why we default to an empty object instead of a value that represents emptiness more precisely, like null. Maybe @razor-x can shed some light on this.
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.
@andrii-balitskyi If there was a documented property (other than action_attempt.result
) that was an empty object, this is likely a mistake and we could add it to the doc report.
As for action_attempt.result
, it starts null
, and then once the action attempt is success
it resolves to a non-null (possibly empty) object. IMO this is an ok pattern, and changing it at this point might be a breaking change for some. The best justification for this I can cook up is that result
is like a response, e.g., our API always returns at least a {}
on a 200. For action attempts that return success, we always return at least a {}
for the result (the "delayed response").
No description provided.