Skip to content

Instantly share code, notes, and snippets.

@grubberr
Created November 18, 2022 15:28
Show Gist options
  • Save grubberr/236776b33dd25e572df12a000ec9f48c to your computer and use it in GitHub Desktop.
Save grubberr/236776b33dd25e572df12a000ec9f48c to your computer and use it in GitHub Desktop.
(Pdb) print(json.dumps(schema, indent=4))
{
"allOf": [
{
"$ref": "#/definitions/PaginationStrategy"
},
{
"type": "object",
"required": [
"page_size"
],
"properties": {
"page_size": {
"anyOf": [
{
"$ref": "#/definitions/InterpolatedString"
},
{
"type": "integer"
}
]
}
}
}
],
"description": "\n Pagination strategy that returns the number of records reads so far and returns it as the next page token\n\n Attributes:\n page_size (int): the number of records to request\n ",
"$schema": "http://json-schema.org/draft-06/schema#",
"definitions": {
"InterpolatedString": {
"type": "object",
"required": [
"string"
],
"properties": {
"string": {
"type": "string"
},
"default": {
"type": "string"
}
},
"description": "\n Wrapper around a raw string to be interpolated with the Jinja2 templating engine\n\n Attributes:\n string (str): The string to evalute\n default (Optional[str]): The default value to return if the evaluation returns an empty string\n options (Mapping[str, Any]): Additional runtime parameters to be used for string interpolation\n "
},
"PaginationStrategy": {
"type": "object",
"properties": {},
"description": "\n Defines how to get the next page token\n "
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment