PHPackages                             softspring/form-schema - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. softspring/form-schema

ActiveComponent[Utility &amp; Helpers](/categories/utility)

softspring/form-schema
======================

Extracts JSON-schema-like metadata from Symfony forms

6.0.x-dev(1mo ago)0371AGPL-3.0-or-laterPHPPHP &gt;=8.4CI passing

Since Jun 24Pushed 1mo agoCompare

[ Source](https://github.com/softspring/form-schema)[ Packagist](https://packagist.org/packages/softspring/form-schema)[ RSS](/packages/softspring-form-schema/feed)WikiDiscussions 6.0 Synced 1w ago

READMEChangelogDependencies (11)Versions (1)Used By (1)

Form Schema
===========

[](#form-schema)

[![Latest Stable](https://camo.githubusercontent.com/f4c70d5c18b0760d9f3ee29bd3dbe96cd4bcb5b8c65692bfa9e1e12c9c7839f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f6674737072696e672f666f726d2d736368656d613f6c6162656c3d737461626c65267374796c653d666c61742d737175617265)](https://github.com/softspring/form-schema/releases)[![Latest Unstable](https://camo.githubusercontent.com/4d99a2139da128502d416585f66213c4be787e76cf28fd72b3459206d0695574/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f6674737072696e672f666f726d2d736368656d613f6c6162656c3d756e737461626c65267374796c653d666c61742d73717561726526696e636c7564655f70726572656c6561736573)](https://github.com/softspring/form-schema/releases)[![License](https://camo.githubusercontent.com/93eea50e0f47335b6c569c1a25cd90799e5b374ac96f751273fd834323ab08cb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736f6674737072696e672f666f726d2d736368656d613f7374796c653d666c61742d737175617265)](https://github.com/softspring/form-schema/blob/6.0/LICENSE)[![PHP Version](https://camo.githubusercontent.com/2a27dbf110488053c42fa54c29fd12fc9e60c2e3f61431cd5b2db09750ecb142/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f736f6674737072696e672f666f726d2d736368656d612f7068703f7374796c653d666c61742d737175617265)](https://github.com/softspring/form-schema/blob/6.0/composer.json)[![Downloads](https://camo.githubusercontent.com/aeb7e03f461db29cb5488219156cd57e0a18eb5d5bf27084a71552cd5ea381e9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f6674737072696e672f666f726d2d736368656d613f7374796c653d666c61742d737175617265)](https://packagist.org/packages/softspring/form-schema)[![CI](https://camo.githubusercontent.com/6168ab040722173cd4be5f6d0103d642d06775608507f201ec39464f05439ceb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736f6674737072696e672f666f726d2d736368656d612f63692e796d6c3f6272616e63683d362e30267374796c653d666c61742d737175617265266c6162656c3d4349)](https://github.com/softspring/form-schema/actions/workflows/ci.yml)[![Coverage](https://camo.githubusercontent.com/fb321ea248821c1b91cb89cff9bfac1b255026c43255a6f5f7cd0f65ecd41d6b/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f736f6674737072696e672f666f726d2d736368656d613f6272616e63683d362e30267374796c653d666c61742d737175617265)](https://app.codecov.io/gh/softspring/form-schema/tree/6.0)

`softspring/form-schema` extracts JSON-schema-like metadata from Symfony forms.

This package is still in active development. Its public API, extracted schema shape, and extension points may change before the first stable release.

What It Provides
----------------

[](#what-it-provides)

- Schema extraction from a Symfony `FormInterface`, form type class, or form type instance.
- Field extractors for scalar fields, compound fields, collections, choices, and buttons.
- Support for explicit `json_schema` and `json_scheme` form options.
- Basic metadata extraction from labels, help text, defaults, and Symfony validator constraints.
- A Symfony bundle that registers the extractor services and field extractor tags.

Installation
------------

[](#installation)

```
composer require softspring/form-schema:^6.0@dev
```

If Symfony Flex does not register the bundle automatically, add it manually:

```
// config/bundles.php
return [
    Softspring\Component\FormSchema\SfsFormSchemaBundle::class => ['all' => true],
];
```

Basic Usage
-----------

[](#basic-usage)

Inject `SchemaExtractor` and extract a schema from a form type:

```
use Softspring\Component\FormSchema\Schema\SchemaExtractor;

final class ExampleService
{
    public function __construct(private SchemaExtractor $schemaExtractor)
    {
    }

    public function schema(): array
    {
        return $this->schemaExtractor->extract(ExampleFormType::class);
    }
}
```

You can also pass a resolved `FormInterface` when the form must be created with application-specific options.

Custom Field Extractors
-----------------------

[](#custom-field-extractors)

Create a service implementing `FieldSchemaExtractorInterface` and tag it with `softspring.form_schema.field_extractor`.

Extractors are evaluated in service order. Return `true` from `supports()` only for the fields your extractor owns.

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md).

[Report issues](https://github.com/softspring/form-schema/issues) and [send Pull Requests](https://github.com/softspring/form-schema/pulls)

Security
--------

[](#security)

See [SECURITY.md](SECURITY.md).

License
-------

[](#license)

This package is free and released under the [AGPL-3.0 license](LICENSE).

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance94

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

31d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/64ac79c0e14e0dd67af72d74bd3531606fb0484230c519a35682d54490f9be5b?d=identicon)[softspring](/maintainers/softspring)

---

Top Contributors

[![javihgil](https://avatars.githubusercontent.com/u/2581053?v=4)](https://github.com/javihgil "javihgil (6 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/softspring-form-schema/health.svg)

```
[![Health](https://phpackages.com/badges/softspring-form-schema/health.svg)](https://phpackages.com/packages/softspring-form-schema)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M400](/packages/easycorp-easyadmin-bundle)[symfony/ux-cropperjs

Cropper.js integration for Symfony

19346.6k3](/packages/symfony-ux-cropperjs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
