Download the PHP package pandaleague/jsonschemabuilder without Composer
On this page you can find all versions of the php package pandaleague/jsonschemabuilder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package jsonschemabuilder
JsonSchemaBuilder
A small, fluent PHP library for assembling JSON Schema documents as PHP arrays — ready to encode to JSON.
Requirements
- PHP 8.3+
illuminate/contracts^11 || ^12
Installation
Quick example
Types
Every builder is created through Factory and returns a fluent instance. All builders implement Illuminate\Contracts\Support\Arrayable, so toArray() produces the final schema.
| Factory | Class | JSON Schema type |
|---|---|---|
Factory::str() |
aStr |
string |
Factory::num() |
aNum |
number |
Factory::bool() |
aBool |
boolean |
Factory::arr() |
aArr |
array |
Factory::obj() |
aObj |
object |
Factory::null() |
aNull |
null |
Shared keywords
Available on every builder (via the BaseType trait):
id(string),schema(string),title(string),description(string)enum(array)— values must match the underlying typeanyOf(Type[]),allOf(Type[]),oneOf(Type[]),not(Type)ref(string)— emitted as$refreadOnly(bool),writeOnly(bool),nullable(bool)link(string $rel, string $href, string $title = '', string $method = 'GET')—$relis restricted to IANA-style relations (self,create,edit,delete,replace,first,last,next,prev,collection,latest-version,search,up)
Strings — aStr
Numbers — aNum
Arrays — aArr
Objects — aObj
Booleans / null
Combining schemas
Development
Install dev dependencies and run the test suite:
License
MIT
All versions of jsonschemabuilder with dependencies
PHP Build Version
Package Version
The package pandaleague/jsonschemabuilder contains the following files
Loading the files please wait ...