Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Schema Generator Laravel Package

api-platform/schema-generator

CLI tool from API Platform that generates PHP class models from vocabularies like Schema.org and ActivityStreams, or from OpenAPI specs. Quickly scaffold types and properties into a ready-to-use PHP codebase for APIs and domain models.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Accelerate API Development: Reduces manual boilerplate for API schemas by auto-generating PHP classes from standardized vocabularies (Schema.org, ActivityStreams, OpenAPI). Enables teams to focus on business logic rather than repetitive data modeling.
  • Standardization & Compliance: Ensures alignment with Schema.org (SEO/structured data) and OpenAPI (API contracts), reducing integration friction with third-party tools (e.g., Google Search Console, API gateways).
  • Build vs. Buy: Buy for teams using API Platform or Symfony (avoids reinventing schema generation). Build only if needing custom validation logic beyond what the package supports.
  • Roadmap Priorities:
    • Semantic Web Projects: Rapidly prototype Linked Data models (e.g., e-commerce with GoodRelations, social media with ActivityStreams).
    • Headless CMS/APIs: Generate DTOs/entities for content models (e.g., articles, products) with minimal configuration.
    • Legacy Modernization: Migrate REST APIs to GraphQL or JSON:LD by auto-generating types from existing OpenAPI specs.
  • Use Cases:
    • Developer Productivity: Cut schema generation time from hours to minutes for standardized domains (e.g., events, products, reviews).
    • Non-Technical Collaboration: Enable marketers/analysts to define Schema.org models via YAML/JSON, then auto-generate PHP classes.
    • Multi-Format APIs: Generate types for REST, GraphQL, and JSON:LD from a single source (via API Platform’s attributes).

When to Consider This Package

  • Adopt When:

    • Your stack includes API Platform or Symfony (core dependencies).
    • You need to generate PHP classes from Schema.org/ActivityStreams/OpenAPI (e.g., for SEO, interoperability, or rapid prototyping).
    • Your team prioritizes developer velocity over fine-grained customization (e.g., 80% of your entities follow standard vocabularies).
    • You’re building semantic web applications (e.g., knowledge graphs, linked data APIs).
    • You want to reduce technical debt in data modeling by enforcing standardized schemas.
  • Look Elsewhere If:

    • You need 100% custom validation logic beyond what the package’s templates support (e.g., complex business rules not expressible in Schema.org).
    • Your project uses non-Symfony/PHP stacks (e.g., Node.js, Python, or Go).
    • You require real-time schema evolution (e.g., dynamic fields not defined in vocabularies) without manual overrides.
    • Your use case involves highly proprietary data models with no alignment to Schema.org/OpenAPI.
    • You’re constrained by legacy codebases where auto-generated classes would conflict with existing inheritance hierarchies (mitigate via updateFiles: false config).

How to Pitch It (Stakeholders)

For Executives:

"This tool cuts API development time by 70% for standardized data models by auto-generating PHP classes from industry vocabularies like Schema.org (SEO) and OpenAPI (API contracts). For example, a product catalog API that previously took 2 weeks to model can now be scaffolded in hours—reducing costs and accelerating time-to-market. It’s a force multiplier for teams building semantic web apps, headless CMS backends, or multi-format APIs (REST/GraphQL/JSON:LD). The MIT license and API Platform backing ensure long-term viability."

For Engineers:

*"Schema Generator lets you trade manual DRY violations for zero-boilerplate PHP classes from Schema.org/OpenAPI. Key wins:

  • One command (php bin/console schema:generate) generates typed entities, Doctrine mappings, and API Platform attributes (e.g., @ApiResource, @Security).
  • Supports modern PHP: Nullable types, PHP 8.4/Symfony 7, and custom attributes (e.g., @ORM\Column overrides).
  • Flexible: Generate DTOs, entities, or embeddables; customize via YAML/JSON config or Twig templates.
  • Interoperable: Outputs align with Google’s structured data, ActivityPub, and OpenAPI tools (Swagger UI, Postman). Example: Generate a Product entity from Schema.org in 5 minutes instead of 2 hours—with built-in SEO metadata and API endpoints.

Trade-offs:

  • Not a silver bullet for 100% custom validation (but mitigated via config overrides).
  • Requires API Platform/Symfony (but the PHAR version works standalone). Try it: composer require api/schema-generator && php bin/console schema:generate --vocabulary=schema.org/Product."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor