diff --git a/py/stencila/schema/types.py b/py/stencila/schema/types.py index f744738d..b8e9ea30 100644 --- a/py/stencila/schema/types.py +++ b/py/stencila/schema/types.py @@ -270,7 +270,7 @@ class CodeChunk(CodeBlock): assigns: Optional[Array[Union[str, "Variable"]]] = None """Variables that the code chunk assigns to.""" - caption: Optional[Union[str, Array["Node"]]] = None + caption: Optional[Union[Array["BlockContent"], str]] = None """A caption for the CodeChunk.""" declares: Optional[Array[Union[str, "Variable", "Function"]]] = None @@ -303,7 +303,7 @@ def __init__( text: str, alters: Optional[Array[str]] = None, assigns: Optional[Array[Union[str, "Variable"]]] = None, - caption: Optional[Union[str, Array["Node"]]] = None, + caption: Optional[Union[Array["BlockContent"], str]] = None, declares: Optional[Array[Union[str, "Variable", "Function"]]] = None, duration: Optional[float] = None, errors: Optional[Array["CodeError"]] = None, @@ -1519,7 +1519,7 @@ class Figure(CreativeWork): and labels for them. """ - caption: Optional[Union[str, Array["Node"]]] = None + caption: Optional[Union[Array["BlockContent"], str]] = None """A caption for the figure.""" label: Optional[str] = None @@ -1531,7 +1531,7 @@ def __init__( about: Optional[Array["Thing"]] = None, alternateNames: Optional[Array[str]] = None, authors: Optional[Array[Union["Person", "Organization"]]] = None, - caption: Optional[Union[str, Array["Node"]]] = None, + caption: Optional[Union[Array["BlockContent"], str]] = None, comments: Optional[Array["Comment"]] = None, content: Optional[Array["Node"]] = None, dateAccepted: Optional["Date"] = None, @@ -3570,7 +3570,7 @@ class Table(CreativeWork): """Rows of cells in the table. """ - caption: Optional[Union[str, Array["Node"]]] = None + caption: Optional[Union[Array["BlockContent"], str]] = None """A caption for the table.""" label: Optional[str] = None @@ -3583,7 +3583,7 @@ def __init__( about: Optional[Array["Thing"]] = None, alternateNames: Optional[Array[str]] = None, authors: Optional[Array[Union["Person", "Organization"]]] = None, - caption: Optional[Union[str, Array["Node"]]] = None, + caption: Optional[Union[Array["BlockContent"], str]] = None, comments: Optional[Array["Comment"]] = None, content: Optional[Array["Node"]] = None, dateAccepted: Optional["Date"] = None, diff --git a/r/R/types.R b/r/R/types.R index d214cca6..04a64022 100644 --- a/r/R/types.R +++ b/r/R/types.R @@ -300,7 +300,7 @@ CodeChunk <- function( self$type <- as_scalar("CodeChunk") self[["alters"]] <- check_property("CodeChunk", "alters", FALSE, missing(alters), Array("character"), alters) self[["assigns"]] <- check_property("CodeChunk", "assigns", FALSE, missing(assigns), Array(Union("character", Variable)), assigns) - self[["caption"]] <- check_property("CodeChunk", "caption", FALSE, missing(caption), Union("character", Array(Node)), caption) + self[["caption"]] <- check_property("CodeChunk", "caption", FALSE, missing(caption), Union(Array(BlockContent), "character"), caption) self[["declares"]] <- check_property("CodeChunk", "declares", FALSE, missing(declares), Array(Union("character", Variable, Function)), declares) self[["duration"]] <- check_property("CodeChunk", "duration", FALSE, missing(duration), "numeric", duration) self[["errors"]] <- check_property("CodeChunk", "errors", FALSE, missing(errors), Array(CodeError), errors) @@ -1719,7 +1719,7 @@ Figure <- function( version = version ) self$type <- as_scalar("Figure") - self[["caption"]] <- check_property("Figure", "caption", FALSE, missing(caption), Union("character", Array(Node)), caption) + self[["caption"]] <- check_property("Figure", "caption", FALSE, missing(caption), Union(Array(BlockContent), "character"), caption) self[["label"]] <- check_property("Figure", "label", FALSE, missing(label), "character", label) class(self) <- c(class(self), "Figure") self @@ -3937,7 +3937,7 @@ Table <- function( ) self$type <- as_scalar("Table") self[["rows"]] <- check_property("Table", "rows", TRUE, missing(rows), Array(TableRow), rows) - self[["caption"]] <- check_property("Table", "caption", FALSE, missing(caption), Union("character", Array(Node)), caption) + self[["caption"]] <- check_property("Table", "caption", FALSE, missing(caption), Union(Array(BlockContent), "character"), caption) self[["label"]] <- check_property("Table", "label", FALSE, missing(label), "character", label) class(self) <- c(class(self), "Table") self diff --git a/schema/CodeChunk.schema.yaml b/schema/CodeChunk.schema.yaml index 3909e022..b910dd65 100644 --- a/schema/CodeChunk.schema.yaml +++ b/schema/CodeChunk.schema.yaml @@ -13,10 +13,10 @@ properties: An array of nodes or, to be compatible with https://schema.org/caption, a string. anyOf: - - type: string - type: array items: - $ref: Node + $ref: BlockContent + - type: string label: '@id': stencila:label description: A short label for the CodeChunk. diff --git a/schema/Figure.schema.yaml b/schema/Figure.schema.yaml index aaab0913..bc99debf 100644 --- a/schema/Figure.schema.yaml +++ b/schema/Figure.schema.yaml @@ -13,10 +13,10 @@ properties: An array of nodes or, to be compatible with https://schema.org/caption, a string. anyOf: - - type: string - type: array items: - $ref: Node + $ref: BlockContent + - type: string label: '@id': stencila:label description: A short label for the figure. diff --git a/schema/Table.schema.yaml b/schema/Table.schema.yaml index 9c571439..45024fda 100644 --- a/schema/Table.schema.yaml +++ b/schema/Table.schema.yaml @@ -13,10 +13,10 @@ properties: An array of nodes or, to be compatible with https://schema.org/caption, a string. anyOf: - - type: string - type: array items: - $ref: Node + $ref: BlockContent + - type: string label: '@id': stencila:label description: A short label for the table.