question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation Is:

  • Missing
  • Needed
  • Confusing
  • Not Sure?

Please Explain in Detail…

Did not find how to describe the entities of the array

Your Proposal for Changes

{
  "directives": {
    "type": ["object"],
    "property": {
      "name": {
        "type": "string"
      },
      "start": {
        "type": "string"
      },
      "end": {
        "type": "string"
      }
    }
  }
}

Where are the brackets [ ] means an array and property describes the essence of an array i.e. object in this case

or

{
  "directives": {
    "type": "array",
    "property": {
      "type": "object",
      "property": {
        "name": {
          "type": "string"
        },
        "start": {
          "type": "string"
        },
        "end": {
          "type": "string"
        }
      }
    }
  }
}

it seems a little more confusing

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
alexander-akaitcommented, Aug 21, 2020

I have provided a link to the documentation, please read it, if you need array with object you should use:

{
  "directives": {
    "type": "array",
    "items": {
      "type": "object",
      "properties": {
         "name": {
            "type": "string"
          },
          "start": {
            "type": "string"
          },
          "end": {
            "type": "string"
          }
        }
      }
    }
  }
}
0reactions
Scrumcommented, Aug 21, 2020

@evilebottnawi ohh yes i missed that. thank

Read more comments on GitHub >

github_iconTop Results From Across the Web

ArrayObject - Manual - PHP
You can easily realise that ArrayObject can use various functions as they are in ArrayIterator to iterate an object-as-a-array. However, you need to...
Read more >
PHP Array and ArrayObject - Stack Overflow
The ArrayObject is a class that you can extend to create objects that behave as if they were arrays. It implements methods like...
Read more >
PHP | ArrayObjects::_construct() Function - GeeksforGeeks
The ArrayObjects class allows objects to work as arrays. The ArrayObjects::_construct() is an in built PHP function to construct a new array ......
Read more >
Illuminate\Database\Eloquent\Casts\ArrayObject | Laravel API
ArrayObject. class ArrayObject extends ArrayObject implements Arrayable , JsonSerializable (View source). Methods. Collection. collect().
Read more >
Advantage of ArrayObject vs normal array - PHP - SitePoint
Frustratingly, and they still haven't fixed this for PHP7, ArrayObjects are not interchangeable with arrays, so methods that require arrays don' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found