a5sys/apiplatform-typescript-generator-bundle
openapi-typescript).api), Symfony Flex, TypeScript toolchain (e.g., tsc, esbuild).symfony/process for CLI execution).satisfies, optional chaining).make:client or similar commands, risking build pipeline fragility.null vs. undefined, union types).Why Not Existing Tools?
openapi-typescript, nswag, or openapi-generator (which have broader adoption and maturity).Maturity Gaps
Performance/Overhead
Team Adoption
npm/yarn links).Prerequisites:
api bundle is installed and OpenAPI schema is accessible (/api endpoint).typescript, @types/node).composer require a5sys/apiplatform-typescript-generator-bundle
Configuration:
config/packages/a5sys_apiplatform_typescript_generator.yaml:
a5sys_apiplatform_typescript_generator:
output_dir: "%kernel.project_dir%/client/src/generated"
templates:
- "@ApiPlatformTypescriptGeneratorBundle/Resources/templates/default.ts.twig"
# Optional: Customize naming, ignore certain resources, etc.
Makefile or symfony/bin/console command).Frontend Integration:
npm install ../client/src/generated).global.d.ts or index.d.ts for project-specific overrides.CI/CD Pipeline:
- name: Generate TypeScript client
run: php bin/console a5sys:apiplatform:generate-ts-client
strict: true flags).SerializerContext or @ApiResource options, test if they’re reflected in generated types.$ref handling).tsc errors due to generated code).npm install + php bin/console).tsc --noEmit).@types or project configs.import type { ... } from './generated/api').How can I help you explore Laravel packages today?