-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Handle in proper way empty object/array in has* like functions #201
Comments
I still have the point of view that |
I like For me, if object or array are empty, |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
I'm wondering what is the point of keeping it open 😄 |
for that :) Probably when we will release |
I think you might be interested in joining #453 |
This is already being handled in the future We could close this ticket once the |
Issue is resolved in v2 ParserJS - now in https://github.com/asyncapi/parser-js/tree/next-major branch |
Reason/Context
After discussion in this PR #192 (comment #192 (comment)) we should consider in which way we should go with handling empty object/array in
has*
like functions. At this moment,parser-js
returnstrue
if given field has object/array with values, and also true if object/array is empty - in those functions is used!!
statement to convert value to boolean. Unfortunately JS treats empty object/array astrue
value. In opposite, empty object/array should treat asfalse
value.Description
If we decide to change default behavior, then changing logic will be huge breaking change to handle schema in templates.
Also we should discuss point of view from this comment: #173 (comment)
The text was updated successfully, but these errors were encountered: