"冒号不能用于不带引号的映射值"服务中的错误.yml



我来这里问我的问题,因为我真的不知道该怎么办,而且我在互联网上找不到正确的信息。我正在为用于与BigQueryneneneba API(GCP(通信的服务绑定参数。为了做到这一点,我将";参数yml";并将参数绑定在";services.yml";。当我重新加载页面时,出现一个错误:";文件/home/doker/symfony/src/xxx/DependencyInjection//Resources/config/services.yml";不包含有效的YAML:在第84行(靠近"$bucketName:%google_bucket_name%"(的未引用映射值中不能使用冒号。

你知道问题出在哪里吗?

请查收附件中";services.yml";以及";参数yml";文件

-services.yml

AdminBundleServicesCustomerChangeSetService:
public: true
autowire: true
autoconfigure: true
bind:
$googleProjectId: "%google_project_id%"
$googlePath: "%kernel.root_dir%/../%google_token_path%"
$googleQuery: "%google_bigquery_dataset%"
$googleConfig: "%config_bigQuery_prod%"
$tableName: "%google_bigquery_table_customerchangeset%"
$bucketName: "%google_bucket_name%"
AdminBundleServicesAPILogsService:
public: true
autowire: true
autoconfigure: true
bind:
$googleProjectId: "%google_project_id%"
$googlePath: "%kernel.root_dir%/../%google_token_path%"
$googleQuery: "%google_bigquery_dataset%"
$googleConfig: "%config_bigQuery_prod%"
$tableName: "%google_bigquery_table_apilogs%"
$bucketName: "%google_bucket_name%"
AdminBundleServicesImportLicenceCodeService:
public: true
autowire: true
autoconfigure: true
bind:
$googleProjectId: "%google_project_id%"
$googlePath: "%kernel.root_dir%/../%google_token_path%"
$googleQuery: "%google_bigquery_dataset%"
$googleConfig: "%config_bigQuery_prod%"
$tableName: "%google_bigquery_table_importlicencecode%"
$bucketName: "%google_bucket_name%"

-参数.yml

google_token_path: ./google_token.json
google_project_id: "xxx"
google_bigquery_dataset: "xxx"
google_bigquery_table_accessmember: "xxx"
google_bigquery_table_customerchangeset: "xxx"
google_bigquery_table_apilogs: "xxx"
google_bigquery_table_importlicencecode: "xxx"
google_bucket_name: "xxx"

PS:该代码似乎在ImportLicenseCodeService 的参数上有问题

提前感谢您的帮助;(

正如@bossman已经指出的那样,答案是意图。

我只是想补充一点,你可以去掉很多不必要的重复。当你这样写的时候:

services:
_defaults:
autowire: true
autoconfigure: true
bind:
$googleProjectId: "%google_project_id%"
$googlePath: "%kernel.root_dir%/../%google_token_path%"
$googleQuery: "%google_bigquery_dataset%"
$googleConfig: "%config_bigQuery_prod%"            
$bucketName: "%google_bucket_name%"
AdminBundleServicesCustomerChangeSetService:
public: true
bind:
$tableName: "%google_bigquery_table_customerchangeset%"

AdminBundleServicesAPILogsService:
public: true
bind:
$tableName: "%google_bigquery_table_apilogs%"

AdminBundleServicesImportLicenceCodeService:
public: true
bind:
$tableName: "%google_bigquery_table_importlicencecode%"

最新更新