contentful.net icon indicating copy to clipboard operation
contentful.net copied to clipboard

Fix SrcDoc serialization for UI extension

Open mrkosima opened this issue 5 years ago • 2 comments

CreateExtension request fails is SrcDoc provided:

contentfulManagementClient.CreateExtension(new UiExtension{
                FieldTypes = new List<string>(),
                Name = "The Extension",
                SrcDoc = "test",
                Sidebar = true
});

Post request payload:

{
  "extension": {
    "srcDoc": "test",
    "name": "The Extension",
    "fieldTypes": [],
    "sidebar": true
  }
}

Error:

Contentful.Core.Errors.ContentfulException: Validation error[
  {
    "name": "unexpected",
    "details": "The property \"srcDoc\" is not expected",
    "path": [
      "extension",
      "srcDoc"
    ]
  },
  {
    "name": "required",
    "details": "The property \"src\" is required here",
    "path": [
      "extension",
      "src"
    ]
  },
  {
    "name": "required",
    "details": "The property \"srcdoc\" is required here",
    "path": [
      "extension",
      "srcdoc"
    ]
  },
  {
    "name": "unless",
    "details": "The property \"src\" or \"srcdoc\" are required here",
    "path": [
      "extension"
    ]
  }
]

mrkosima avatar Dec 17 '19 15:12 mrkosima

Hi @mrkosima thanks for the contribution. I will have a look and get back to you.

Roblinde avatar Dec 17 '19 21:12 Roblinde

hey @Roblinde, kindly remind you to check the PR :)

mrkosima avatar Feb 14 '20 14:02 mrkosima