options not bubbling to Symfony routes (option: ['expose'
Describe the bug
FosRoutingBundle is not dumping the route even if options: ['expose' => true] is configured.
To Reproduce
#[Route('/', name: 'package_show', options: ['expose' => true], methods: [Request::METHOD_GET])]
#[AdminRoute('/bundle/{packageId}', name: 'bundle_show', options: ['expose' => true])]
(OPTIONAL) Additional context
bin/console fos:js-routing:dump --format=js --target=public/js/fos_js_routes.js --callback="export default "
grep package_show public/js/fos_js_routes.js
grep admin public/js/fos_js_routes.js
Only the route defined by the Symfony route is exposed and written by FosRoutingBundle.
Dumping exposed routes.
[file+] public/js/fos_js_routes.js
export default ({"base_url":"","routes":{"meili_insta":{"tokens":[["variable","/","[^/]++","indexName",true],["text","/meiliAdmin/meiliAdmin/instant-search/index"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"survos_workflow_transition":{"tokens":[["variable",".","[^/]++","_format",true],["variable","/","[^/\.]++","transition",true],["variable","/","[^/]++","entityIdentifier",true],["variable","/","[^/]++","workflowCode",true],["text","/state/workflow/transition"]],"defaults":{"transition":null,"_format":"html"},"requirements":[],"hosttokens":[],"methods":[],"schemes":[]},"package_transition":{"tokens":[["variable","/","[^/]++","transition",true],["text","/transition"],["variable","/","[^/]++","packageId",true],["text","/package"]],"defaults":{"transition":null},"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"package_show":{"tokens":[["text","/"],["variable","/","[^/]++","packageId",true],["text","/package"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]}},"prefix":"","host":"packages.wip","port":"","scheme":"https","locale":""}); ~/g/sites/packages$ ~/g/sites/packages$
I was able to get this to work by dumping ALL the easyadmin routes
easyadmin:
resource: .
type: easyadmin.routes
options:
expose: true
I had the same problem and it seems this solves it :
#[AdminRoute('/bundle/{packageId}', name: 'bundle_show', options: ['options' => ['expose' => true]])]
Perhaps this behavior can be changed in version 5. Or documented. Thanks for the solution!