\App\CoreModule\ModelsJsonSchemaManager

Tool for reading and validating JSON schemas

Summary

Methods
Properties
Constants
__construct()
delete()
exists()
read()
write()
getDirectory()
setSchemaFromComponent()
setSchemaFromMessageType()
validate()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(  configDir) : 

Constructor

Parameters

configDir

Directory with JSON schemas

Returns

delete()

delete(  fileName) : 

Deletes the file

Parameters

fileName

File name

Throws

\App\CoreModule\Models\IOException

Returns

exists()

exists(  fileName) : 

Checks if the file exists

Parameters

fileName

File name

Returns

Is file exists?

read()

read(  fileName) : 

Reads the file

Parameters

fileName

File name

Throws

\App\CoreModule\Models\IOException

Returns

File content

write()

write(  fileName,   content) : 

Writes into the file

Parameters

fileName

File name

content

File content

Throws

\App\CoreModule\Models\IOException

Returns

getDirectory()

getDirectory() : 

Returns the directory with files

Returns

Directory with files

setSchemaFromComponent()

setSchemaFromComponent(  component) : 

Sets the file name of JSON schema from the component name

Parameters

component

Component name

Throws

\App\CoreModule\Models\NonExistingJsonSchemaException

Returns

setSchemaFromMessageType()

setSchemaFromMessageType(  mType) : 

Sets the file name of JSON schema from the API message type

Parameters

mType

Message type

Throws

\App\CoreModule\Models\NonExistingJsonSchemaException

Returns

validate()

validate(  json,   tryFix = false) : 

Validates JSON

Parameters

json

JSON to validate

tryFix

Try fix JSON?

Throws

\App\CoreModule\Models\InvalidJsonException
\App\CoreModule\Models\JsonException

Returns

Is the JSON valid?