json = '''{
"type": "Request",
"kind": "TeamsWebhook",
"inputs": {
"triggerAuthenticationType": "All",
"schema": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"contentType": {
"contentType": {
"type": "string"
}
},
"content": {
"content": {
"type": "object",
"properties": {
"$schema": {
"type": "string"
},
"type": {
"type": "string"
},
"version": {
"type": "string"
},
"body": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
},
"required": [
"type"
]
}
}
}
}
}
},
"required": [
"contentType",
"content"
]
}
}
}
}
},
"metadata": {}
}'''
import re
better_json = re.sub(r'^((\s*)".*?":)\s*([\[{])', r'\1\n\2\3', json, flags=re.MULTILINE)
print(better_json)
anNvbiA9ICcnJ3sKICAidHlwZSI6ICJSZXF1ZXN0IiwKICAia2luZCI6ICJUZWFtc1dlYmhvb2siLAogICJpbnB1dHMiOiB7CiAgICAidHJpZ2dlckF1dGhlbnRpY2F0aW9uVHlwZSI6ICJBbGwiLAogICAgInNjaGVtYSI6IHsKICAgICAgInR5cGUiOiAib2JqZWN0IiwKICAgICAgInByb3BlcnRpZXMiOiB7CiAgICAgICAgInR5cGUiOiB7CiAgICAgICAgICAidHlwZSI6ICJzdHJpbmciCiAgICAgICAgfSwKICAgICAgICAiYXR0YWNobWVudHMiOiB7CiAgICAgICAgICAidHlwZSI6ICJhcnJheSIsCiAgICAgICAgICAiaXRlbXMiOiB7CiAgICAgICAgICAgICJ0eXBlIjogIm9iamVjdCIsCiAgICAgICAgICAgICJwcm9wZXJ0aWVzIjogewogICAgICAgICAgICAgICJjb250ZW50VHlwZSI6IHsKICAgICAgICAgICAgICAgICJjb250ZW50VHlwZSI6IHsKICAgICAgICAgICAgICAgICAgInR5cGUiOiAic3RyaW5nIgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgImNvbnRlbnQiOiB7CiAgICAgICAgICAgICAgICAiY29udGVudCI6IHsKICAgICAgICAgICAgICAgICAgInR5cGUiOiAib2JqZWN0IiwKICAgICAgICAgICAgICAgICAgInByb3BlcnRpZXMiOiB7CiAgICAgICAgICAgICAgICAgICAgIiRzY2hlbWEiOiB7CiAgICAgICAgICAgICAgICAgICAgICAidHlwZSI6ICJzdHJpbmciCiAgICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICAgICAidHlwZSI6IHsKICAgICAgICAgICAgICAgICAgICAgICJ0eXBlIjogInN0cmluZyIKICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgICAgICJ2ZXJzaW9uIjogewogICAgICAgICAgICAgICAgICAgICAgInR5cGUiOiAic3RyaW5nIgogICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAgICAgImJvZHkiOiB7CiAgICAgICAgICAgICAgICAgICAgICAidHlwZSI6ICJhcnJheSIsCiAgICAgICAgICAgICAgICAgICAgICAiaXRlbXMiOiB7CiAgICAgICAgICAgICAgICAgICAgICAgICJ0eXBlIjogIm9iamVjdCIsCiAgICAgICAgICAgICAgICAgICAgICAgICJwcm9wZXJ0aWVzIjogewogICAgICAgICAgICAgICAgICAgICAgICAgICJ0eXBlIjogewogICAgICAgICAgICAgICAgICAgICAgICAgICAgInR5cGUiOiAic3RyaW5nIgogICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICAgICAgICAgInJlcXVpcmVkIjogWwogICAgICAgICAgICAgICAgICAgICAgICAgICJ0eXBlIgogICAgICAgICAgICAgICAgICAgICAgICBdCiAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9LAogICAgICAgICAgICAicmVxdWlyZWQiOiBbCiAgICAgICAgICAgICAgImNvbnRlbnRUeXBlIiwKICAgICAgICAgICAgICAiY29udGVudCIKICAgICAgICAgICAgXQogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfQogICAgfQogIH0sCiAgIm1ldGFkYXRhIjoge30KfScnJwoKaW1wb3J0IHJlCmJldHRlcl9qc29uID0gcmUuc3ViKHInXigoXHMqKSIuKj8iOilccyooW1xbe10pJywgcidcMVxuXDJcMycsIGpzb24sIGZsYWdzPXJlLk1VTFRJTElORSkKcHJpbnQoYmV0dGVyX2pzb24p
{
"type": "Request",
"kind": "TeamsWebhook",
"inputs":
{
"triggerAuthenticationType": "All",
"schema":
{
"type": "object",
"properties":
{
"type":
{
"type": "string"
},
"attachments":
{
"type": "array",
"items":
{
"type": "object",
"properties":
{
"contentType":
{
"contentType":
{
"type": "string"
}
},
"content":
{
"content":
{
"type": "object",
"properties":
{
"$schema":
{
"type": "string"
},
"type":
{
"type": "string"
},
"version":
{
"type": "string"
},
"body":
{
"type": "array",
"items":
{
"type": "object",
"properties":
{
"type":
{
"type": "string"
}
},
"required":
[
"type"
]
}
}
}
}
}
},
"required":
[
"contentType",
"content"
]
}
}
}
}
},
"metadata":
{}
}