
Research
Malicious Go “crypto” Module Steals Passwords and Deploys Rekoobe Backdoor
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.
021/json-schema
Advanced tools
This library provides a way to generate JSON schemas in PHP using an object-oriented approach. It is inspired by the JSON Schema standard and aims to provide a way to generate JSON schemas in a more readable and maintainable way.
composer require 021/json-schema
use O21\JsonSchema\Schema;
use O21\JsonSchema\Enums\Type;
use O21\JsonSchema\Enums\Format;
$schema = new Schema(
schema: 'http://json-schema.org/draft-07/schema#',
type: Type::OBJECT,
properties: [
'name' => new Schema(
type: Type::STRING,
minLength: 1,
maxLength: 255
),
'age' => new Schema(
type: Type::INTEGER,
minimum: 0,
maximum: 150
),
'addresses' => new Schema(
type: Type::ARRAY,
items: new Schema(
type: Type::OBJECT,
properties: [
'street' => new Schema(
type: Type::STRING,
minLength: 1,
maxLength: 255
),
'city' => new Schema(
type: Type::STRING,
minLength: 1,
maxLength: 255
),
'zip' => new Schema(
type: Type::STRING,
pattern: '^[0-9]{5}$'
)
],
required: ['street', 'city', 'zip']
),
),
'email' => new Schema(
type: Type::STRING,
format: Format::EMAIL
),
'phone' => new Schema(
type: Type::STRING,
pattern: '^\+[0-9]{1,3}\.[0-9]{1,14}$'
),
'is_active' => new Schema(
type: Type::BOOLEAN,
default: true,
),
]
);
// Convert the schema to JSON
$json = $schema->toJson();
// Convert the schema to an object
$obj = $schema->toObject();
Almost all properties listed on the JSON Schema reference are supported, but if some properties are missing in the current version of the library or you want to add your own, you can use the transform method.
It is called when the Schema class is transformed into the stdClass class to generate JSON from it:
use O21\JsonSchema\Schema;
$schema = new Schema(
transform: function (stdClass $schema): void {
$schema->foo = 'bar';
}
);
FAQs
Object-Oriented JSON Schema Generation
We found that 021/json-schema demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.

Security News
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.