Search code examples
yamlmulesoftanypoint-studio

Add section Include into properties yaml - Anypoint studio


I am new to Anypoint Studio and MuleSoft, and I am trying to pick up the projects from the previous developer.

In his note, I will need to add the section 'Include' into the properties yaml, but I have tried several different ways and still got error, please correct me.

YAML file:

apiId: xxxxxx
  
https:
  host: "0.0.0.0"
  port: "8082"

batch:
  data: 
    host: "localhost"
    port: "8082"
    path: "/api/xxx"
    secure: "false"
    scheduler:
    frequency: "1440"

Request:
    targetSystem:
        authtoken:
          XXXXXXXXX

        api:
          XXXXXXXX
          Query:
              param1: XXXX
              paramValue1: "1234"
              reference:
                  include: xxxxx
                  include: xxxxx

Solution

  • This seems to be a properties file used in a Mule application. Properties files are custom configurations that hold whatever values are used in property placeholders in your application. The values and organization are not mandated by a standard, only the format (YAML in this case). Since it is custom configuration for custom applications no one will know where the values should defined in the file or what values, without knowledge of the application.

    As an example, in the application you want to reference property placeholder for the include ${Request.targetSystem.api.Query.reference.include}

    You probably should avoid repeated keys (ie multiple include keys). Try naming them differently (include1, include2,...).