# Why does plotly.validate not pass for this layout

**URL:** <https://community.plotly.com/t/why-does-plotly-validate-not-pass-for-this-layout/41559>\
**Category:** plotly.js\
**Created:** [June 25, 2020, 2:08pm UTC](https://community.plotly.com/t/why-does-plotly-validate-not-pass-for-this-layout/41559 "2020-06-25T14:08:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fk4517](https://avatars.discourse-cdn.com/v4/letter/f/aeb1de/32.png) [@fk4517](https://community.plotly.com/u/fk4517)\
**Post date:** [June 25, 2020, 2:08pm UTC](https://community.plotly.com/t/why-does-plotly-validate-not-pass-for-this-layout/41559/1 "2020-06-25T14:08:15Z")

</div>

Hi,

I am checking to see how the plotly.validate functions work. At the moment I have this following code for my layout:

```auto
var trace1 = {
  x: [1, 2, 3, 4],
  y: [10, 15, 13, 17],
  mode: 'markers',
  type: 'scatter'
};

var trace2 = {
  x: [2, 3, 4, 5],
  y: [16, 5, 11, 9],
  mode: 'lines',
  type: 'scatter'
};

var traces= [
  {
    name: "test",
    type: "histogram",
    xaxis: "x",
    yaxis: "y",
    x: [1,2,3],
  }
] 

const layout = 
      {
        "title":"XY.Histogram.Basic",
       "legend":{
         "showlegend":true,
         "x":0,
         "y":1,
         "orientation":"v"
       },
       "height":500,
       "width":800,
       "grid":{
         "rows":1,
         "columns":1,
         "pattern":"independent"
       },
       "xaxis":{
         "title":"x",
         "side":"",
         "overlaying":"",
         "showgrid":true,
         "zeroline":false,
         "showline":false
       },"yaxis":{
         "title":"y",
         "side":"",
         "overlaying":"",
         "showgrid":true,
         "zeroline":false,
         "showline":false
       }
      }

console.log(Plotly.validate(traces, layout))

```

If I run this code as below, it console logs an error:

See the Pen [Plotly.js Line and Scatter Plot](https://codepen.io/fkE3/pen/wvMeXmr) by fuzzy ([@fkE3](https://codepen.io/fkE3)) on [CodePen](https://codepen.io).

Why is validation failing here? Any guidance is much appreciated

---

<div class="post-metadata">

**Author:** ![Saratoga](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/saratoga/32/28634_2.png) [@Saratoga](https://community.plotly.com/u/Saratoga)\
**Post date:** [June 25, 2020, 11:29pm UTC](https://community.plotly.com/t/why-does-plotly-validate-not-pass-for-this-layout/41559/2 "2020-06-25T23:29:19Z")

</div>

remove the last comma from here x: [1,2,3],
