首页 > 解决方案 > 使用数组时未正确处理 Yaml

问题描述

这个 yaml 对我来说很好用

---
idp:
  type: oauth
  resources:
    - type: api
      name: my-name
      external_facing: false
      allowed_scopes:  #These are the scopes that are available to use.
        - read 
        - write
        - reports
        - admin
      allowed_clients:
        - artifact_guid: <senstive-info>   
          environment_keys:
            - development
          scopes: 
            - read
            - write
    - type: client
      name: oauthclient  

虽然我想添加另一个 idp 配置所以希望在数组中使用它,但尝试了这个

---
idp:
  - type: oauth
    resources:
      - type: api
        name: my-name
        external_facing: false
        allowed_scopes:
          - read
          - write
          - reports
          - admin
        allowed_clients:
          - artifact_guid: <sensitive-info>   
            environment_keys:
              - development 
            scopes:  
              - read
              - write
          - type: client
            name: oauthclient  
  - provider: azure
    applications:
      - name: my-name
        home_page_url: <sensitive info>
        email_address: <sensitive info>
        oidc: true
        reply_urls:
          - <sensitive info>
          - <sensitive info>

我在第二个 yaml 上遇到的错误表明 Artifact Guid 没有被正确读取,因为部署抱怨它找不到它。

谢谢

标签: jsontypescriptparsingyamlidp

解决方案


    - type: client
      name: oauthclient  

在以下格式中缩进不正确


推荐阅读