Skip to content

Commit

Permalink
Don't complain of format mix on inclued .json
Browse files Browse the repository at this point in the history
  • Loading branch information
sebaszm committed Jan 11, 2024
1 parent fac816d commit d152205
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion JsonGenerator/source/json_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,11 @@ def __init__(self, name, parent, schema, included=None, property=False):
elif (self.rpc_format == config.RpcFormat.EXTENDED) and not property and not isinstance(self.params, (JsonObject, JsonArray, JsonNull)):
raise JsonParseError("With 'extended' format parameters to a method or event need to be an object or an array: '%s'" % self.print_name)
elif (self.rpc_format == config.RpcFormat.COLLAPSED) and isinstance(self.params, JsonObject) and (len(self.params.properties) == 1):
log.Warn("'%s': with 'collapsed' format methods and events with one parameter should not have an outer object" % self.print_name)
warning = "'%s': with 'collapsed' format methods and events with one parameter should not have an outer object" % self.print_name
if included:
log.Info(warning)
else:
log.Warn(warning)

if "alt" in schema:
self.alternative = schema.get("alt")
Expand Down

0 comments on commit d152205

Please sign in to comment.