superset-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-superset] dpgaspar commented on a change in pull request #9724: docs(api): improve openapi documentation for dash, charts and queries
Date Mon, 04 May 2020 16:18:37 GMT

dpgaspar commented on a change in pull request #9724:
URL: https://github.com/apache/incubator-superset/pull/9724#discussion_r419552769



##########
File path: superset/charts/schemas.py
##########
@@ -38,35 +95,74 @@ def validate_json(value: Union[bytes, bytearray, str]) -> None:
 
 
 class ChartPostSchema(Schema):
-    slice_name = fields.String(required=True, validate=Length(1, 250))
-    description = fields.String(allow_none=True)
-    viz_type = fields.String(allow_none=True, validate=Length(0, 250))
-    owners = fields.List(fields.Integer())
-    params = fields.String(allow_none=True, validate=validate_json)
-    cache_timeout = fields.Integer(allow_none=True)
-    datasource_id = fields.Integer(required=True)
-    datasource_type = fields.String(required=True)
-    datasource_name = fields.String(allow_none=True)
-    dashboards = fields.List(fields.Integer())
+    """
+    Schema to add a new chart.
+    """
+
+    slice_name = fields.String(
+        description=slice_name_description, required=True, validate=Length(1, 250)
+    )
+    description = fields.String(description=description_description, allow_none=True)

Review comment:
       There are some slight differences, my understanding is that `required`, requires that
a field is present, but the field can be present but the value is `null` for example.
   
   So on the above example, `description` may be present on the payload or not, and if present
it can be `null`
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Mime
View raw message